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
-[Combine Loader](https://www.npmjs.com/package/webpack-combine-loaders) - Converts a loaders array into a single loader string. -- _Maintainer_: `James Friend`[![Github][githubicon]](https://github.com/jsdf)
100
99
-[Icon Font Loader](https://github.com/vusion/icon-font-loader) - Converts svgs into font icons in CSS. -- _Maintainer_: `Forrest R. Zhao`[![Github][githubicon]](https://github.com/rainfore)
101
100
-[Icons Loader](https://www.npmjs.com/package/icons-loader) - Generates an iconfont from SVG dependencies. -- _Maintainer_: `Mike Vercoelen`[![Github][githubicon]](https://github.com/mikevercoelen)
Copy file name to clipboardExpand all lines: src/content/configuration/devtool.mdx
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,7 @@ related:
18
18
---
19
19
20
20
This option controls if and how source maps are generated.
21
-
22
-
Use the [`SourceMapDevToolPlugin`](/plugins/source-map-dev-tool-plugin) for a more fine grained configuration. See the [`source-map-loader`](/loaders/source-map-loader) to deal with existing source maps.
21
+
Use the [`SourceMapDevToolPlugin`](/plugins/source-map-dev-tool-plugin) for a more fine grained configuration. See the [`Rule.extractSourceMap`](/configuration/module/#ruleextractsourcemap) to deal with existing source maps.
Copy file name to clipboardExpand all lines: src/content/configuration/experiments.mdx
+2-17Lines changed: 2 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,11 +27,11 @@ Available options:
27
27
-[`css`](#experimentscss)
28
28
-[`deferImport`](#experimentsdeferimport)
29
29
-[`futureDefaults`](#experimentsfuturedefaults)
30
-
-`layers`: Enable module and chunk layers.
31
30
-[`lazyCompilation`](#experimentslazycompilation)
32
31
-[`outputModule`](#experimentsoutputmodule)
33
32
-`syncWebAssembly`: Support the old WebAssembly like in webpack 4.
34
-
-[`topLevelAwait`](#experimentstoplevelawait)
33
+
-`layers`: Enable module and chunk layers, removed and works without additional options since `5.102.0`.
34
+
-`topLevelAwait`: Transforms a module into an `async` module when an `await` is used at the top level. Starting from webpack version `5.83.0` (however, in versions prior to that, you can enable it by setting `experiments.topLevelAwait` to `true`), this feature is enabled by default, removed and works without additional options since `5.102.0`.
35
35
36
36
**webpack.config.js**
37
37
@@ -41,7 +41,6 @@ module.exports = {
41
41
experiments: {
42
42
asyncWebAssembly:true,
43
43
buildHttp:true,
44
-
layers:true,
45
44
lazyCompilation:true,
46
45
outputModule:true,
47
46
syncWebAssembly:true,
@@ -368,17 +367,3 @@ module.exports = {
368
367
},
369
368
};
370
369
```
371
-
372
-
### experiments.topLevelAwait
373
-
374
-
`boolean = true`
375
-
376
-
The `topLevelAwait` option transforms a module into an `async` module when an `await` is used at the top level. Starting from webpack version `5.83.0`, this feature is enabled by default. However, in versions prior to that, you can enable it by setting `experiments.topLevelAwait` to `true`.
// No generator options are supported for this module type yet
146
+
}
144
147
javascript: {
145
148
// No generator options are supported for this module type yet
146
149
},
@@ -249,6 +252,9 @@ module.exports = {
249
252
'asset/source': {
250
253
// ditto
251
254
},
255
+
'asset/bytes': {
256
+
// ditto
257
+
},
252
258
javascript: {
253
259
// Parser options for javascript modules
254
260
// e.g, enable parsing of require.ensure syntax
@@ -1019,6 +1025,28 @@ module.exports = {
1019
1025
};
1020
1026
```
1021
1027
1028
+
## Rule.extractSourceMap
1029
+
1030
+
`boolean = false`
1031
+
1032
+
Extracts existing source map data from files (from their `//# sourceMappingURL` comment), useful for preserving the source maps of third-party libraries.
1033
+
1034
+
**webpack.config.js**
1035
+
1036
+
```js
1037
+
module.exports= {
1038
+
// ...
1039
+
module: {
1040
+
rules: [
1041
+
{
1042
+
test:/\.m?js$/,
1043
+
extractSourceMap:true,
1044
+
},
1045
+
],
1046
+
},
1047
+
};
1048
+
```
1049
+
1022
1050
## Rule.loader
1023
1051
1024
1052
`Rule.loader` is a shortcut to `Rule.use: [ { loader } ]`. See [`Rule.use`](#ruleuse) and [`UseEntry.loader`](#useentry) for details.
@@ -1280,11 +1308,11 @@ module.exports = {
1280
1308
module: {
1281
1309
rules: [
1282
1310
{
1283
-
test:/\.png/,
1311
+
test:/\.png$/,
1284
1312
type:'asset/resource',
1285
1313
},
1286
1314
{
1287
-
test:/\.html/,
1315
+
test:/\.html$/,
1288
1316
type:'asset/resource',
1289
1317
generator: {
1290
1318
filename:'static/[hash][ext]',
@@ -1444,7 +1472,7 @@ Include all modules that pass test assertion. If you supply a `Rule.test` option
`Rule.type` sets the type for a matching module. This prevents defaultRules and their default importing behaviors from occurring. For example, if you want to load a `.json` file through a custom loader, you'd need to set the `type` to `javascript/auto` to bypass webpack's built-in json importing.
0 commit comments