react-redux-typescript-boilerplate
react-redux-typescript-boilerplate copied to clipboard
Updating to React 17 and Webpack 5
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-loaderandfile-loader- also recommended in the guide. -
Rule.query (deprecated since v3) → Rule.options/UseEntry.options
loader.options->loader.postcssOptions- Changed
splitChunks.namefromfalsetotrueas recommended here. - Removed the need for the
node.fsworkaround, since it's sorted in Webpack 5. - Changed
devtoolin development mode fromcheap-module-eval-source-maptoeval-cheap-module-source-map, since it was a breaking change in the latest version of Devtool. - The
disableproperty 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! 😃