Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"socket.io-client": "^1.3.5",
"style-loader": "^0.13.1",
"watch-ignore-webpack-plugin": "^1.0.0",
"webpack": "^1.13.1",
"webpack": "^2.2.0",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Upgrading Webpack from v1 to v2 is a major change that includes many breaking changes. Your current Webpack configuration files will not work with Webpack 2 and need to be updated. Without these changes, your build will fail.

Here are some of the required changes I've identified:

In both webpack.config.js and webpack.prod.config.js:

  • resolve.extensions: The empty string '' is no longer needed for resolving extensionless files and should be removed from the array. In Webpack 2, you should not use an empty string.
  • module.loaders: This has been renamed to module.rules.
  • json-loader: This is no longer necessary as Webpack 2 handles JSON files by default. You can remove this loader.
  • ExtractTextPlugin: The syntax for ExtractTextPlugin.extract has changed. The old string-based syntax is no longer valid. You'll need to migrate to the new object-based syntax. For example:
    ExtractTextPlugin.extract({
      fallback: 'style-loader',
      use: [
        { loader: 'css-loader', options: { sourceMap: true } },
        { loader: 'sass-loader', options: { sourceMap: true } }
      ]
    })

In webpack.config.js:

  • module.preLoaders: This has been removed. You should merge its contents into module.rules and use the enforce: 'pre' property on the rule.

In webpack.prod.config.js:

  • webpack.DefinePlugin: The current configuration for DefinePlugin overwrites the entire process.env object. It should be changed to only define process.env.NODE_ENV:
    new webpack.DefinePlugin({
      'process.env.NODE_ENV': JSON.stringify('production')
    })

I strongly recommend consulting the official Webpack v1 to v2 migration guide for a complete list of changes and detailed instructions.

"xpath-dom": "^0.2.2"
},
"devDependencies": {
Expand Down