Upgrading css-loader 3 to 4
Breaking3.6.0 → 4.3.0Breaking12Platform1New9Changed3Fixed6
BreakingUpgrade verdict
12 breaking changes and a platform requirement change.
In plain terms
- CSS modules now emit ES modules by default instead of CommonJS.
- Whether source maps are generated now follows your webpack devtool setting.
- ICSS handling is off unless you configure the modules option.
- The option controlling the base path for local class names has a new name.
Must act Top 4 of 13 that need code or config changes
Node.js requirement changed in 4.0.0: >= 8.9.0 → >= 10.13.0.
Drops normalize-path.
Installs 27 packages in all (was 29).
What you must change
Breaking12
Makes the
esModule option true by default.esModuleMakes the default value of the
sourceMap option depend on the devtool option.sourceMapdevtoolDisables the
icss plugin by default; the modules option must be set up to enable it.icssmodulesRenames the
modules.context option to modules.localIdentContext.modules.contextmodules.localIdentContextDefaults
modules.localIdentContext to compiler.context for the module.getLocalIdent option.modules.localIdentContextcompiler.contextmodule.getLocalIdentRenames the
modules.hashPrefix option to modules.localIdentHashPrefix.modules.hashPrefixmodules.localIdentHashPrefixMoves and renames the
localsConvention option to modules.exportLocalsConvention.localsConventionmodules.exportLocalsConventionMoves and renames the
onlyLocals option to modules.exportOnlyLocals.onlyLocalsmodules.exportOnlyLocalsEnables the
modules option by default for files matching /\\.module\\.\w+$/i.test(filename), with module.auto true by default.modulesmodule.autoRequires the
getLocalIndent option to always be a Function returning a String value.getLocalIndentChanges the arguments of the
import option function to function(url, media, resourcePath) {}.importChanges inline syntax so
~ is written before the file request.Platform1
Raises the minimum required Node.js version to 10.13.0.