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

Updating to React 17 and Webpack 5 #100

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

LuchoTurtle
Copy link

Hey there @rokoroku 👋 !

Cheers for the amazing repo! It's bloody amazing and quite useful to get something started with React!

This PR is meant to update every dependency, including migration to React 16 and Webpack from v4 to v5. The latter implies changing the webpack.config.js file. I've followed the migration guide from Webpack and their recommended practices and put them here! 😄

Most importantly:

  • Changed every occurrence from '[hash]' to '[content]', as recommended from the aforementioned guide. This also deals with caching, so we don't need to worry about different environments.
  • Added Asset Modules, replacing url-loader, raw-loader and file-loader - also recommended in the guide.
  • Rule.query (deprecated since v3) → Rule.options/UseEntry.options

  • loader.options -> loader.postcssOptions
  • Changed splitChunks.name from false to true as recommended here.
  • Removed the need for the node.fs workaround, since it's sorted in Webpack 5.
  • Changed devtool in development mode from cheap-module-eval-source-map to eval-cheap-module-source-map, since it was a breaking change in the latest version of Devtool.
  • The disable property from MiniCssExtractPlugin was removed. So we are conditionally adding it to the plugins array depending on build type (production or development) to mimick the same logic you previously had.

Hopefully you can merge this PR so everyone can benefit from an updated version of this amazing repo! 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant