Upgrade to webpack 5
ProprietaryUpgrade a webpack 4 project to webpack 5. Moves file-loader, url-loader and raw-loader rules without options to asset modules (ReplaceWebpackLoadersWithAssetModules), renames the optimization options the migration guide lists (UpdateWebpackOptimizationOptions), replaces node: {fs: 'empty'}-style options with resolve.fallback (ReplaceWebpackNodeEmptyWithResolveFallback), marks what remains (FindWebpack5ManualMigrations), then upgrades webpack to 5.x with webpack-cli 6.x, webpack-dev-server 5.x, html-webpack-plugin 5.x, terser-webpack-plugin 5.x, copy-webpack-plugin 12.x, css-loader 7.x, style-loader 4.x and babel-loader 9.x. Not done by this recipe: loaders with options (url-loader limit), NamedModulesPlugin-style plugins (marked), devServer options, Node.js polyfills that need an explicit fallback, mini-css-extract-plugin and ts-loader, which have their own versions, and Node.js 18.12 or later for webpack-cli 6 and webpack-dev-server 5.
org. openrewrite. nodejs. migrate. webpack. UpgradeToWebpack5mod run . --recipe= org. openrewrite. nodejs. migrate. webpack. UpgradeToWebpack5Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.