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/plugins/dll-plugin.mdx
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ related:
17
17
18
18
The `DllPlugin` and `DllReferencePlugin` provide means to split bundles in a way that can drastically improve build time performance. The term "DLL" stands for Dynamic-link library which was originally introduced by Microsoft.
19
19
20
-
## `DllPlugin`
20
+
## DllPlugin
21
21
22
22
This plugin is used in a separate webpack configuration exclusively to create a dll-only-bundle. It creates a `manifest.json` file, which is used by the [`DllReferencePlugin`](#dllreferenceplugin) to map dependencies.
23
23
@@ -38,7 +38,7 @@ Creates a `manifest.json` which is written to the given `path`. It contains mapp
38
38
39
39
Combine this plugin with [`output.library`](/configuration/output/#outputlibrary) option to expose (aka, put into the global scope) the dll function.
40
40
41
-
## `DllReferencePlugin`
41
+
## DllReferencePlugin
42
42
43
43
This plugin is used in the primary webpack config, it references the dll-only-bundle(s) to require pre-built dependencies.
Copy file name to clipboardExpand all lines: src/content/plugins/environment-plugin.mdx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -103,7 +103,7 @@ new webpack.EnvironmentPlugin({
103
103
});
104
104
```
105
105
106
-
## `DotenvPlugin`
106
+
## DotenvPlugin
107
107
108
108
The third-party [`DotenvPlugin`](https://github.com/mrsteele/dotenv-webpack) (`dotenv-webpack`) allows you to expose (a subset of) [dotenv variables](https://www.npmjs.com/package/dotenv):
Copy file name to clipboardExpand all lines: src/content/plugins/split-chunks-plugin.mdx
+30-30Lines changed: 30 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ webpack provides a set of options for developers that want more control over thi
50
50
51
51
W> The default configuration was chosen to fit web performance best practices, but the optimal strategy for your project might differ. If you're changing the configuration, you should measure the effect of your changes to ensure there's a real benefit.
52
52
53
-
## `optimization.splitChunks`
53
+
## optimization.splitChunks
54
54
55
55
This configuration object represents the default behavior of the `SplitChunksPlugin`.
56
56
@@ -89,13 +89,13 @@ W> When files paths are processed by webpack, they always contain `/` on Unix sy
89
89
90
90
W> Since webpack 5, passing an entry name to `{cacheGroup}.test` and using a name of an existing chunk for `{cacheGroup}.name` is no longer allowed.
91
91
92
-
### `splitChunks.automaticNameDelimiter`
92
+
### splitChunks.automaticNameDelimiter
93
93
94
94
`string = '~'`
95
95
96
96
By default webpack will generate names using origin and name of the chunk (e.g. `vendors~main.js`). This option lets you specify the delimiter to use for the generated names.
97
97
98
-
### `splitChunks.chunks`
98
+
### splitChunks.chunks
99
99
100
100
`string = 'async'``function (chunk)`
101
101
@@ -133,69 +133,69 @@ module.exports = {
133
133
134
134
T> You can combine this configuration with the [HtmlWebpackPlugin](/plugins/html-webpack-plugin/). It will inject all the generated vendor chunks for you.
135
135
136
-
### `splitChunks.maxAsyncRequests`
136
+
### splitChunks.maxAsyncRequests
137
137
138
138
`number = 30`
139
139
140
140
Maximum number of parallel requests when on-demand loading.
141
141
142
-
### `splitChunks.maxInitialRequests`
142
+
### splitChunks.maxInitialRequests
143
143
144
144
`number = 30`
145
145
146
146
Maximum number of parallel requests at an entry point.
147
147
148
-
### `splitChunks.defaultSizeTypes`
148
+
### splitChunks.defaultSizeTypes
149
149
150
150
`[string] = ['javascript', 'unknown']`
151
151
152
152
Sets the size types which are used when a number is used for sizes.
153
153
154
-
### `splitChunks.minChunks`
154
+
### splitChunks.minChunks
155
155
156
156
`number = 1`
157
157
158
158
The minimum times must a module be shared among chunks before splitting.
159
159
160
-
### `splitChunks.hidePathInfo`
160
+
### splitChunks.hidePathInfo
161
161
162
162
`boolean`
163
163
164
164
Prevents exposing path info when creating names for parts splitted by maxSize.
165
165
166
-
### `splitChunks.minSize`
166
+
### splitChunks.minSize
167
167
168
168
`number = 20000`
169
169
170
170
Minimum size, in bytes, for a chunk to be generated.
`splitChunks.minRemainingSize` option was introduced in webpack 5 to avoid zero sized modules by ensuring that the minimum size of the chunk which remains after splitting is above a limit. Defaults to `0` in ['development' mode](/configuration/mode/#mode-development). For other cases `splitChunks.minRemainingSize` defaults to the value of `splitChunks.minSize` so it doesn't need to be specified manually except for the rare cases where deep control is required.
187
187
188
188
W> `splitChunks.minRemainingSize` only takes effect when a single chunk is remaining.
189
189
190
-
### `splitChunks.layer`
190
+
### splitChunks.layer
191
191
192
-
#### `splitChunks.cacheGroups.{cacheGroup}.layer`
192
+
#### splitChunks.cacheGroups.{cacheGroup}.layer
193
193
194
194
`RegExp``string``function`
195
195
196
196
Assign modules to a cache group by module layer.
197
197
198
-
### `splitChunks.maxSize`
198
+
### splitChunks.maxSize
199
199
200
200
`number = 0`
201
201
@@ -210,23 +210,23 @@ T> `maxSize` takes higher priority than `maxInitialRequest/maxAsyncRequests`. Ac
210
210
211
211
T> Setting the value for `maxSize` sets the value for both `maxAsyncSize` and `maxInitialSize`.
212
212
213
-
### `splitChunks.maxAsyncSize`
213
+
### splitChunks.maxAsyncSize
214
214
215
215
`number`
216
216
217
217
Like `maxSize`, `maxAsyncSize` can be applied globally (`splitChunks.maxAsyncSize`), to cacheGroups (`splitChunks.cacheGroups.{cacheGroup}.maxAsyncSize`), or to the fallback cache group (`splitChunks.fallbackCacheGroup.maxAsyncSize`).
218
218
219
219
The difference between `maxAsyncSize` and `maxSize` is that `maxAsyncSize` will only affect on-demand loading chunks.
220
220
221
-
### `splitChunks.maxInitialSize`
221
+
### splitChunks.maxInitialSize
222
222
223
223
`number`
224
224
225
225
Like `maxSize`, `maxInitialSize` can be applied globally (`splitChunks.maxInitialSize`), to cacheGroups (`splitChunks.cacheGroups.{cacheGroup}.maxInitialSize`), or to the fallback cache group (`splitChunks.fallbackCacheGroup.maxInitialSize`).
226
226
227
227
The difference between `maxInitialSize` and `maxSize` is that `maxInitialSize` will only affect initial load chunks.
@@ -279,16 +279,16 @@ Running webpack with following `splitChunks` configuration would also output a c
279
279
280
280
W> When assigning equal names to different split chunks, all vendor modules are placed into a single shared chunk, though it's not recommend since it can result in more code downloaded.
Figure out which exports are used by modules to mangle export names, omit unused exports and generate more efficient code.
289
289
When it is `true`: analyse used exports for each runtime, when it is `"global"`: analyse exports globally for all runtimes combined).
290
290
291
-
### `splitChunks.cacheGroups`
291
+
### splitChunks.cacheGroups
292
292
293
293
Cache groups can inherit and/or override any options from `splitChunks.*`; but `test`, `priority` and `reuseExistingChunk` can only be configured on cache group level. To disable any of the default cache groups, set them to `false`.
A module can belong to multiple cache groups. The optimization will prefer the cache group with a higher `priority`. The default groups have a negative priority to allow custom groups to take higher priority (default value is `0` for custom groups).
0 commit comments