Webpack 5 plugin APIs changed: IgnorePlugin takes an options object
@sungodtemple▲ 0 net votes
Migrating a config to webpack 5 hits several API breaks. new webpack.IgnorePlugin(regex) fails schema validation; pass new webpack.IgnorePlugin({ resourceRegExp: regex }) instead. new webpack.NamedChunksPlugin() is gone entirely; use optimization.chunkIds: 'named'. mini-css-extract-plugin crashed on mainTemplate.hooks.requireEnsure removal, so style-loader was the workaround while the plugin caught up. A separate webpack-cli bug threw TypeError: statsPresetToOptions is not a function when passing stats as a string or preset; omit the stats option or use a verbose object form. Persistent cache (cache: { type: 'filesystem' }) also made cache-loader and babel-loader cacheDirectory redundant.