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
Copy file name to clipboardExpand all lines: src/content/configuration/module.mdx
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -748,6 +748,50 @@ The `'relative'` value for `module.parser.javascript.url` is available since web
748
748
1. This is useful for SSR (Server side rendering) when base URL is not known by server (and it saves a few bytes). To be identical it must also be used for the client build.
749
749
2. Also for static site generators, mini-css-plugin and html-plugin, etc. where server side rendering is commonly needed.
750
750
751
+
#### module.parser.javascript.parse
752
+
753
+
<Badgetext="5.103.0+" />
754
+
755
+
Use a custom JavaScript parse function instead of webpack's built-in parser.
756
+
757
+
Return `ast`, `comments`, and `semicolons` to ensure webpack’s AST analysis works correctly.
758
+
759
+
-`ast` should be ESTree-compatible.
760
+
-`comments` is an array of ESTree comment nodes.
761
+
-`semicolons` is a set of positions where the parser inserted a semicolon.
Copy file name to clipboardExpand all lines: src/content/guides/output-management.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -216,7 +216,7 @@ Now run an `npm run build` and inspect the `/dist` folder. If everything went we
216
216
217
217
You might be wondering how webpack and its plugins seem to "know" what files are being generated. The answer is in the manifest that webpack keeps to track how all the modules map to the output bundles. If you're interested in managing webpack's [`output`](/configuration/output) in other ways, the manifest would be a good place to start.
218
218
219
-
The manifest data can be extracted into a json file for consumption using the [`WebpackManifestPlugin`](https://github.com/shellscape/webpack-manifest-plugin).
219
+
The manifest data can be extracted into a json file for consumption using the [`ManifestPlugin`](/plugins/manifest-plugin/).
220
220
221
221
We won't go through a full example of how to use this plugin within your projects, but you can read up on [the concept page](/concepts/manifest) and the [caching guide](/guides/caching) to find out how this ties into long term caching.
Copy file name to clipboardExpand all lines: src/content/plugins/eval-source-map-dev-tool-plugin.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,9 +26,9 @@ new webpack.EvalSourceMapDevToolPlugin(options);
26
26
27
27
The following options are supported:
28
28
29
-
-`test` (`string|RegExp|array`): Include source maps for modules based on their extension (defaults to `.js` and `.css`).
30
-
-`include` (`string|RegExp|array`): Include source maps for module paths that match the given value.
31
-
-`exclude` (`string|RegExp|array`): Exclude modules that match the given value from source map generation.
29
+
-`test` (`string``RegExp``function (asset) => boolean``[string, RegExp, function (asset) => boolean]`): Include source maps for modules based on their extension (defaults to `.js` and `.css`).
30
+
-`include` (`string``RegExp``function (asset) => boolean``[string, RegExp, function (asset) => boolean]`): Include source maps for module paths that match the given value.
31
+
-`exclude` (`string``RegExp``function (asset) => boolean``[string, RegExp, function (asset) => boolean]`): Exclude modules that match the given value from source map generation.
32
32
-`append` (`string|function`): Appends the given value to the original asset. Usually the `#sourceMappingURL` comment. `[url]` is replaced with a URL to the source map file.
33
33
34
34
Starting from version 5.84.0, webpack allows the `append` option to be a function that accepts path data and an asset info object as arguments, and returns a string.
@@ -37,7 +37,7 @@ The following options are supported:
-`ignoreList` (`string|RegExp|array`): Decide whether to ignore source files that match the specified value in source maps.
40
+
-`ignoreList` (`string``RegExp``function (source) => boolean``[string, RegExp, function (source) => boolean]`): Decide whether to ignore source files that match the specified value in source maps.
41
41
-`module` (`boolean`): Indicates whether loaders should generate source maps (defaults to `true`).
42
42
-`moduleFilenameTemplate` (`string`): See [`output.devtoolModuleFilenameTemplate`](/configuration/output/#outputdevtoolmodulefilenametemplate).
43
43
-`columns` (`boolean`): Indicates whether column mappings should be used (defaults to `true`).
The built-in `ManifestPlugin` generates one asset manifest for your build. Port from [`WebpackManifestPlugin`](https://github.com/shellscape/webpack-manifest-plugin).
12
+
13
+
**webpack.config.js**
14
+
15
+
```javascript
16
+
newwebpack.ManifestPlugin({
17
+
// options...
18
+
});
19
+
```
20
+
21
+
## Options
22
+
23
+
### `entrypoints`
24
+
25
+
`boolean = true`
26
+
27
+
Enables generation of the `entrypoints` section in the manifest.
28
+
29
+
When `entrypoints` is enabled and one entry uses `dependOn`
30
+
31
+
**webpack.config.js**
32
+
33
+
```javascript
34
+
module.exports= {
35
+
entry: {
36
+
entry1: {
37
+
import:'./src/file_1.js',
38
+
dependOn:'entry2',
39
+
},
40
+
entry2:'./src/file_2.js',
41
+
},
42
+
plugins: [
43
+
newwebpack.ManifestPlugin({
44
+
filename:'manifest.json',
45
+
}),
46
+
],
47
+
};
48
+
```
49
+
50
+
The resulting manifest will contain the parent/child relationship map
51
+
52
+
**manifest.json**
53
+
54
+
```json
55
+
{
56
+
"entrypoints": {
57
+
"entry1": {
58
+
"imports": ["entry1.js"],
59
+
"parents": ["entry2"]
60
+
},
61
+
"entry2": {
62
+
"imports": ["entry2.js"]
63
+
}
64
+
}
65
+
}
66
+
```
67
+
68
+
### `filename`
69
+
70
+
`string = manifest.json`
71
+
72
+
Specifies the filename of the output file on disk. By default the plugin will emit `manifest.json` inside the `output.path` directory.
73
+
74
+
### `filter`
75
+
76
+
`(item: ManifestItem) => boolean`
77
+
78
+
Allows filtering the files which make up the manifest.
Copy file name to clipboardExpand all lines: src/content/plugins/source-map-dev-tool-plugin.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,9 @@ new webpack.SourceMapDevToolPlugin(options);
24
24
25
25
The following options are supported:
26
26
27
-
-`test` (`string``RegExp``[string, RegExp]`): Include source maps for modules based on their extension (defaults to `.js`, `.mjs`, and `.css`).
28
-
-`include` (`string``RegExp``[string, RegExp]`): Include source maps for module paths that match the given value.
29
-
-`exclude` (`string``RegExp``[string, RegExp]`): Exclude modules that match the given value from source map generation.
27
+
-`test` (`string``RegExp``function (asset) => boolean``[string, RegExp, function (asset) => boolean]`): Include source maps for modules based on their extension (defaults to `.js`, `.mjs`, and `.css`).
28
+
-`include` (`string``RegExp``function (asset) => boolean``[string, RegExp, function (asset) => boolean]`): Include source maps for module paths that match the given value.
29
+
-`exclude` (`string``RegExp``function (asset) => boolean``[string, RegExp], function (asset) => boolean`): Exclude modules that match the given value from source map generation.
30
30
-`filename` (`string`): Defines the output filename of the SourceMap (will be inlined if no value is provided).
31
31
-`append` (`string``function``false`): Appends the given value to the original asset. Usually the `#sourceMappingURL` comment. `[url]` is replaced with a URL to the source map file. Since webpack v4.36.0, path parameters are supported: `[chunk]`, `[filename]` and `[contenthash]`. Setting `append` to `false` disables the appending.
32
32
@@ -38,7 +38,7 @@ The following options are supported:
38
38
39
39
-`moduleFilenameTemplate` (`string`): See [`output.devtoolModuleFilenameTemplate`](/configuration/output/#outputdevtoolmodulefilenametemplate).
40
40
-`fallbackModuleFilenameTemplate` (`string`): See link above.
41
-
-`ignoreList` (`string|RegExp|array`): Decide whether to ignore source files that match the specified value in source maps.
41
+
-`ignoreList` (`string``RegExp``function (source) => boolean``[string, RegExp, function (source) => boolean]`): Decide whether to ignore source files that match the specified value in source maps.
-`columns = true` (`boolean`): Indicates whether column mappings should be used.
44
44
-`namespace` (`string`): Namespace prefix to allow multiple webpack roots in the devtools. See [`output.devtoolNamespace`](/configuration/output/#outputdevtoolnamespace).
0 commit comments