Releases: webpack/css-loader
Releases · webpack/css-loader
v6.2.0
v6.1.0
v6.0.0
6.0.0 (2021-07-14)
Notes
- using
~is deprecated when theesModulesoption is enabled (enabled by default) and can be removed from your code (we recommend it) (url(~package/image.png)->url(package/image.png),@import url(~package/style.css)->@import url(package/style.css),composes: import from '~package/one.css';->composes: import from 'package/one.css';), but we still support it for historical reasons. Why can you remove it? The loader will first try to resolve@import/url()/etc as relative, if it cannot be resolved, the loader will try to resolve@import/url()/etc insidenode_modulesor modules directories. file-loaderandurl-loaderare deprecated, please migrate onasset modules, since v6css-loaderis generatingnew URL(...)syntax, it enables by default built-inassets modules, i.e.type: 'asset'for allurl()
⚠ BREAKING CHANGES
- minimum supported
Node.jsversion is12.13.0 - minimum supported
webpackversion is5, we recommend to update to the latest version for better performance - for
urlandimportoptionsFunctiontype was removed in favorObjecttype with thefilterproperty, i.e. before{ url: () => true }, now{ url: { filter: () => true } }and before{ import: () => true }, now{ import: { filter: () => true } } - the
modules.compileTypeoption was removed in favor themodules.modeoption withicssvalue, also themodulesoption can haveicssstring value new URL()syntax used forurl(), only when theesModulesoption is enabled (enabled by default), it means you can bundle CSS for libraries- data URI are handling in
url(), it means you can register loaders for them, example - aliases with
falsevalue forurl()now generate empty data URI (i.e.data:0,), only when theesModulesoption is enabled (enabled by default) [ext]placeholder don't need.(dot) before for thelocalIdentNameoption, i.e. please change.[ext]on[ext](no dot before)[folder]placeholder was removed without replacement for thelocalIdentNameoption, please use a custom function if you need complex logic[emoji]placeholder was removed without replacement for thelocalIdentNameoption, please use a custom function if you need complex logic- the
localIdentHashPrefixwas removed in favor thelocalIdentHashSaltoption
Features
- supported
resolve.byDependency.cssresolve options for@import - supported
resolve.byDependency.icssresolve CSS modules and ICSS imports (i.e.composes/etc) - added
modules.localIdentHashFunction,modules.localIdentHashDigest,modules.localIdentHashDigestLengthoptions for better class hashing controlling - less dependencies
Bug Fixes
- better performance
- fixed circular
@import