v6.0.0
          ·
          
            199 commits
          
          to master
          since this release
        
        
        
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-loaderand- url-loaderare deprecated, please migrate on- asset modules, since v6- css-loaderis generating- new URL(...)syntax, it enables by default built-in- assets modules, i.e.- type: 'asset'for all- url()
⚠ 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 for- url(), only when the- esModulesoption 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 the- localIdentNameoption, i.e. please change- .[ext]on- [ext](no dot before)
- [folder]placeholder was removed without replacement for the- localIdentNameoption, please use a custom function if you need complex logic
- [emoji]placeholder was removed without replacement for the- localIdentNameoption, 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