Skip to content

v4.0.0

Compare
Choose a tag to compare
@alexander-akait alexander-akait released this 07 Sep 17:18
· 175 commits to master since this release

⚠ BREAKING CHANGES

  • minimum supported Node.js version is 10.13
  • minimum supported webpack version is 4
  • postcss was moved to peerDependencies, you need to install postcss
  • PostCSS (plugins/syntax/parser/stringifier) options was moved to the postcssOptions option, please look at docs
  • sourceMap default value depends on the compiler.devtool option
  • the inline value was removed for the sourceMap option, please use { map: { inline: true, annotation: false } } to achieve this
  • source maps contain absolute paths in sources
  • loader output only CSS, so you need to use css-loader/file-loader/raw-loader to inject code inside bundle
  • exec option was renamed to the execute option
  • the config option doesn't support Object type anymore, config.path and config.ctx options were removed
  • argument in the config for Function notation (previously config.ctx) was changed, now it contains { file, mode, webpackLoaderContext }
  • loader context in the config was renamed from webpack to webpackLoaderContext

Features

  • message API for emit assets (#443) (e966ab9)
  • reuse AST from other loaders (#468) (9b75888)
  • allows to use config and loader options together, options from the loader takes precedence over the config, the plugins option from the config and options are merged (0eb5aaf)
  • postcssOptions options can be Function

Bug Fixes

  • compatibility with webpack@5 (#437) (ed50491)
  • default export for plugins (#465) (3d32c35)
  • avoid mutations of loader options and config (#470) (cad6f07)
  • respect the map option from loader options and config (#458) (98441ff)

Notes

  • you don't need ident option for loader
  • Object syntax for the plugin option is soft deprecated, please migrate on Array syntax (plugins: ['postcss-present-env', ['cssnano', options]])