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/migrate/3.mdx
+18-18Lines changed: 18 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ The following sections describe the major changes from webpack 1 to 2.
22
22
23
23
T> Note that there were far fewer changes between 2 and 3, so that migration shouldn't be too bad. If you are running into issues, please see [the changelog](https://github.com/webpack/webpack/releases) for details.
These options were replaced by a single option `resolve.modules`. See [resolving](/configuration/resolve) for more usage.
28
28
@@ -36,15 +36,15 @@ These options were replaced by a single option `resolve.modules`. See [resolving
36
36
}
37
37
```
38
38
39
-
## `resolve.extensions`
39
+
## resolve.extensions
40
40
41
41
This option no longer requires passing an empty string. This behavior was moved to `resolve.enforceExtension`. See [resolving](/configuration/resolve) for more usage.
42
42
43
-
## `resolve.*`
43
+
## resolve.\*
44
44
45
45
Several APIs were changed here. Not listed in detail as it's not commonly used. See [resolving](/configuration/resolve) for details.
46
46
47
-
## `module.loaders` is now `module.rules`
47
+
## module.loaders is now module.rules
48
48
49
49
The old loader configuration was superseded by a more powerful rules system, which allows configuration of loaders and more.
50
50
For compatibility reasons, the old `module.loaders` syntax is still valid and the old names are parsed.
@@ -134,7 +134,7 @@ You can still opt-in to the old behavior with the `resolveLoader.moduleExtension
134
134
135
135
See [#2986](https://github.com/webpack/webpack/issues/2986) for the reason behind this change.
136
136
137
-
## `json-loader` is not required anymore
137
+
## json-loader is not required anymore
138
138
139
139
When no loader has been configured for a JSON file, webpack will automatically try to load the JSON
140
140
file with the [`json-loader`](https://github.com/webpack-contrib/json-loader).
@@ -176,7 +176,7 @@ You may remove some hacks to work around this:
176
176
}
177
177
```
178
178
179
-
## `module.preLoaders` and `module.postLoaders` were removed:
179
+
## module.preLoaders and module.postLoaders were removed:
180
180
181
181
```diff
182
182
module: {
@@ -191,7 +191,7 @@ You may remove some hacks to work around this:
191
191
}
192
192
```
193
193
194
-
## `UglifyJsPlugin` sourceMap
194
+
## UglifyJsPlugin sourceMap
195
195
196
196
The `sourceMap` option of the `UglifyJsPlugin` now defaults to `false` instead of `true`. This means that if you are using source maps for minimized code or want correct line numbers for uglifyjs warnings, you need to set `sourceMap: true` for `UglifyJsPlugin`.
197
197
@@ -204,7 +204,7 @@ The `sourceMap` option of the `UglifyJsPlugin` now defaults to `false` instead o
204
204
]
205
205
```
206
206
207
-
## `UglifyJsPlugin` warnings
207
+
## UglifyJsPlugin warnings
208
208
209
209
The `compress.warnings` option of the `UglifyJsPlugin` now defaults to `false` instead of `true`.
210
210
This means that if you want to see uglifyjs warnings, you need to set `compress.warnings` to `true`.
@@ -220,7 +220,7 @@ This means that if you want to see uglifyjs warnings, you need to set `compress.
220
220
]
221
221
```
222
222
223
-
## `UglifyJsPlugin` minimize loaders
223
+
## UglifyJsPlugin minimize loaders
224
224
225
225
`UglifyJsPlugin` no longer switches loaders into minimize mode. The `minimize: true` setting needs to be passed via loader options in the long-term. See loader documentation for relevant options.
226
226
@@ -236,11 +236,11 @@ To keep compatibility with old loaders, loaders can be switched to minimize mode
236
236
]
237
237
```
238
238
239
-
## `DedupePlugin` has been removed
239
+
## DedupePlugin has been removed
240
240
241
241
`webpack.optimize.DedupePlugin` isn't needed anymore. Remove it from your configuration.
242
242
243
-
## `BannerPlugin` - breaking change
243
+
## BannerPlugin - breaking change
244
244
245
245
`BannerPlugin` no longer accepts two parameters, but a single options object.
246
246
@@ -251,7 +251,7 @@ To keep compatibility with old loaders, loaders can be switched to minimize mode
251
251
]
252
252
```
253
253
254
-
## `OccurrenceOrderPlugin` is now on by default
254
+
## OccurrenceOrderPlugin is now on by default
255
255
256
256
The `OccurrenceOrderPlugin` is now enabled by default and has been renamed (`OccurenceOrderPlugin` in webpack 1).
257
257
Thus make sure to remove the plugin from your configuration:
@@ -265,15 +265,15 @@ Thus make sure to remove the plugin from your configuration:
265
265
]
266
266
```
267
267
268
-
## `ExtractTextWebpackPlugin` - breaking change
268
+
## ExtractTextWebpackPlugin - breaking change
269
269
270
270
[ExtractTextPlugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) requires version 2 to work with webpack 2.
The configuration changes for this plugin are mainly syntactical.
275
275
276
-
### `ExtractTextPlugin.extract`
276
+
### ExtractTextPlugin.extract
277
277
278
278
```diff
279
279
module: {
@@ -291,7 +291,7 @@ module: {
291
291
}
292
292
```
293
293
294
-
### `new ExtractTextPlugin({options})`
294
+
### new ExtractTextPlugin({options})
295
295
296
296
```diff
297
297
plugins: [
@@ -341,7 +341,7 @@ module.exports = function (env) {
341
341
342
342
See [CLI](/api/cli).
343
343
344
-
## `require.ensure` and AMD `require` are asynchronous
344
+
## require.ensure and AMD require are asynchronous
345
345
346
346
These functions are now always asynchronous instead of calling their callback synchronously if the chunk is already loaded.
347
347
@@ -402,7 +402,7 @@ module.exports = {
402
402
};
403
403
```
404
404
405
-
## `LoaderOptionsPlugin` context
405
+
## LoaderOptionsPlugin context
406
406
407
407
Some loaders need context information and read them from the configuration. This needs to be passed via loader options in the long-term. See loader documentation for relevant options.
408
408
@@ -418,7 +418,7 @@ To keep compatibility with old loaders, this information can be passed via plugi
418
418
]
419
419
```
420
420
421
-
## `debug`
421
+
## debug
422
422
423
423
The `debug` option switched loaders to debug mode in webpack 1. This needs to be passed via loader options in long-term. See loader documentation for relevant options.
0 commit comments