Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Webpack 4.0 #1549

Closed
rodeyseijkens opened this issue Feb 26, 2018 · 3 comments
Closed

Upgrade to Webpack 4.0 #1549

rodeyseijkens opened this issue Feb 26, 2018 · 3 comments

Comments

@rodeyseijkens
Copy link

rodeyseijkens commented Feb 26, 2018

Well Webpack 4.0 is out and it is of course awesome, so we need an upgrade.

Things to ook out for:

  • You have to choose (mode or --mode) between two modes now: production or development
  • ModuleConcatenationPlugin -> optimization.concatenateModules (on by default in production mode)
  • CommonsChunkPlugin was removed -> optimization.splitChunks, optimization.runtimeChunk
  • Resolving can now be configured with module.rules[].resolve. It's merged with the global configuration.

There is probably more but these are the first things that I saw that needed to be addressed I think.

UPDATE:
So far I have it working, but there is a weird bug in BundleAnalyzerPlugin where it cannot analyse the "shared" bundle. Not sure why but probably has to do something with JSONP
I'll make an PR soon with the "bug" in there.

@joemewes
Copy link

joemewes commented Mar 1, 2018

where are you specifying the --mode option ? Inline with the babel-node tools/run start command? or in the build/start scripts somewhere?

@rodeyseijkens
Copy link
Author

@joemewes In the webpack config itself.
The PR was wrong, too many changes from my own fork, but the initial setup was there:
https://github.com/rodeyseijkens/react-starter-kit/blob/73c445017ef57414dd6c9ed2bac862ccb4436488/tools/webpack.config.js#L35

@tim-soft
Copy link

tim-soft commented Mar 4, 2018

Have you tested BundleAnalyzerPlugin after this PR? webpack-contrib/webpack-bundle-analyzer#159

langpavel added a commit that referenced this issue Mar 24, 2018
* Updated for webpack 4
* Updated start.js with webpack 4 hooks API
* Removed NoEmitOnErrorsPlugin and NamedModulesPlugin
* Updated Layout.test to have mocked pathname in context
* Removed "assets-webpack-plugin" in favour of "webpack-assets-manifest"
* Changed `vendor.js` → `vendors.js` — naming consistency with webpack
* `assets.json` → `asset-manifest.json`
* new file `chunk-manifest.json` for SSR support

Closes #1562, #1549
n-parasochka pushed a commit to n-parasochka/react-starter-kit that referenced this issue Apr 29, 2019
* Updated for webpack 4
* Updated start.js with webpack 4 hooks API
* Removed NoEmitOnErrorsPlugin and NamedModulesPlugin
* Updated Layout.test to have mocked pathname in context
* Removed "assets-webpack-plugin" in favour of "webpack-assets-manifest"
* Changed `vendor.js` → `vendors.js` — naming consistency with webpack
* `assets.json` → `asset-manifest.json`
* new file `chunk-manifest.json` for SSR support

Closes kriasoft#1562, kriasoft#1549
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants