mini-css-extract-plugin
Advanced tools
Changelog
2.0.0 (2021-06-30)
In the current release we have fixed many problems with publicPath
, previously to generate relative URLs inside CSS files developers use different hacks: publicPath: ''
, publicPath: '../'
, using relative ../../
in the outputPath
option for file-loader
and etc. Now you don't need it anymore. Webpack v5 uses publicPath: "auto"
by default, which means to always generate relative URLs, and now mini-css-extract-plugin
does the same.
We strongly recommend use auto
value by default (except when using CDN).
We also want to show you that the file-loader
and url-loader
are outdated, please migrate on Asset Modules.
Node.js
version is 12.13.0
webpack
version is 5.0.0
modules.namedExport
option was removed, you don't need it anymore, because we respect the modules.namedExport
option from css-loader
, just remove itpublicPath
option no longer automatically adds /
(trailing slash), you need to specify, you need to specify it yourself if it is absent, i.e. if you have publicPath: "/my/public/path"
replace it with publicPath: "/my/public/path/"
url()
for assets inside CSS files when you use publicPath: "auto"
(default value)