You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also you can [specify a function](/configuration/module/#ruleparserdataurlcondition) to decide to inlining a module or not.
392
+
393
+
## Replacing Inline Loader Syntax
394
+
395
+
Before Asset Modules and Webpack 5, it was possible to use [inline syntax](https://webpack.js.org/concepts/loaders/#inline) with the legacy loaders mentioned above.
396
+
397
+
It is now reccomended to remove all inline loader syntax and use a resourceQuery condition to mimic the functionality of the inline syntax.
398
+
399
+
For example, in the case of replacing `raw-loader` with `asset/source` type:
400
+
401
+
```diff
402
+
-importmyModulefrom'raw-loader!my-module';
403
+
+importmyModulefrom'my-module?raw';
404
+
```
405
+
406
+
and in the webpack configuration:
407
+
408
+
```diff
409
+
module: {
410
+
rules: [
411
+
// ...
412
+
+ {
413
+
+ resouceQuery:/raw/
414
+
+ type:'asset/source'
415
+
+ }
416
+
]
417
+
},
418
+
```
419
+
420
+
and if you'd like to exclude raw assets from being parsed by other loaders, use a negative lookahead:
0 commit comments