Releases: webpack-contrib/css-loader
Releases · webpack-contrib/css-loader
v6.2.0
v6.1.0
v6.0.0
6.0.0 (2021-07-14)
Notes
- using
~
is deprecated when theesModules
option 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_modules
or modules directories. file-loader
andurl-loader
are deprecated, please migrate onasset modules
, since v6css-loader
is generatingnew URL(...)
syntax, it enables by default built-inassets modules
, i.e.type: 'asset'
for allurl()
⚠ BREAKING CHANGES
- minimum supported
Node.js
version is12.13.0
- minimum supported
webpack
version is5
, we recommend to update to the latest version for better performance - for
url
andimport
optionsFunction
type was removed in favorObject
type with thefilter
property, i.e. before{ url: () => true }
, now{ url: { filter: () => true } }
and before{ import: () => true }
, now{ import: { filter: () => true } }
- the
modules.compileType
option was removed in favor themodules.mode
option withicss
value, also themodules
option can haveicss
string value new URL()
syntax used forurl()
, only when theesModules
option 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
false
value forurl()
now generate empty data URI (i.e.data:0,
), only when theesModules
option is enabled (enabled by default) [ext]
placeholder don't need.
(dot) before for thelocalIdentName
option, i.e. please change.[ext]
on[ext]
(no dot before)[folder]
placeholder was removed without replacement for thelocalIdentName
option, please use a custom function if you need complex logic[emoji]
placeholder was removed without replacement for thelocalIdentName
option, please use a custom function if you need complex logic- the
localIdentHashPrefix
was removed in favor thelocalIdentHashSalt
option
Features
- supported
resolve.byDependency.css
resolve options for@import
- supported
resolve.byDependency.icss
resolve CSS modules and ICSS imports (i.e.composes
/etc) - added
modules.localIdentHashFunction
,modules.localIdentHashDigest
,modules.localIdentHashDigestLength
options for better class hashing controlling - less dependencies
Bug Fixes
- better performance
- fixed circular
@import