Skip to content

Conversation

@nstrelow
Copy link
Contributor

Webpack

  • upgrade to webpack 4, comes with many default optimizations for dev and prod
  • Use webpack-config-utils to unify webpack configs
  • Use MiniCssExtractPlugin instead of ExtractTextPlugin (used for CSS only and highly recommended by ExtractTextPlugin for webpack 4)
  • Use one rule for sass and css -> ExtractText/MiniCssExtract now also extracts .css files
  • Remove indentedSyntax, is now automatically set per file (needed for sass/css): Make the indentedSyntax option a bit smarter. webpack/sass-loader#196
  • Rule for .yml: Remove depracated json-loader and use js-yaml-loader to directly convert to JS
  • Remove DefinePlugin process.node.ENV as this is set now automatically by mode
  • Use OptimizeCSSAssetsPlugin to minify CSS
  • Parallelize for UglifyJS. (Without optimize.minify, webpack would default to UglifyJS in production mode without parallelization)

Other

  • Use const instead of var in server.js

@nstrelow
Copy link
Contributor Author

PS: Wasted a few days upgrading to webpack 4 and cleaning up the webpack config. I hope I never have to do that again.

@nstrelow nstrelow self-assigned this Jul 12, 2018
@manuel-hegner
Copy link
Contributor

@Kadrian will this ever be useful? otherwise lets close this PR.

@Kadrian
Copy link
Collaborator

Kadrian commented Jan 7, 2019

I do like this in general, but I'd have to test it before merging. So would vote to keep this open

@nstrelow
Copy link
Contributor Author

nstrelow commented Jan 8, 2019

I would suggest using this as an example to build a new webpack config. Not all packages need to be upgraded, but I would upgrade the version numbers of the webpack ones

@manuel-hegner manuel-hegner assigned Kadrian and unassigned nstrelow Feb 7, 2019
@manuel-hegner manuel-hegner requested review from Kadrian and removed request for MarcusBaitz and rs22 February 10, 2019 13:55
@Kadrian
Copy link
Collaborator

Kadrian commented Feb 12, 2019

Closing this in favor of #335

@Kadrian Kadrian closed this Feb 12, 2019
@manuel-hegner manuel-hegner deleted the feature/upgrade_webpack4 branch February 14, 2019 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants