Skip to content

Commit 720038b

Browse files
committed
Add ?raw resource query
1 parent 56dc1c4 commit 720038b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

config/webpack.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,13 @@ module.exports = (env, argv) => {
407407
// match the requirements. When no loader matches it will fall
408408
// back to the "file" loader at the end of the loader list.
409409
oneOf: [
410+
// Add ability to inline assets (like .md files) directly into the bundle.
411+
// This is done by adding ?raw to the import, like import Content from './content.md?raw';
412+
// See https://webpack.js.org/guides/asset-modules/#replacing-inline-loader-syntax for more details.
413+
{
414+
resourceQuery: /raw/,
415+
type: 'asset/source',
416+
},
410417
// "url" loader works like "file" loader except that it embeds assets
411418
// smaller than specified limit in bytes as data URLs to avoid requests.
412419
// A missing `test` is equivalent to a match.

0 commit comments

Comments
 (0)