Releases: webpack-contrib/postcss-loader
Releases · webpack-contrib/postcss-loader
v2.0.2
v2.0.1
2017-05-08
Bug Fixes
- index: 'Cannot create property
prev
on booleanfalse
' (options.sourceMap
) (c4f0064)
v2.0.0
2017-05-08
Features
options.config
- index: add
ctx
,ctx.file
,ctx.options
(0dceb2c)
webpack.config.js
{
test: /\.css$/
use: [
{
loader: 'postcss-loader',
options: {
config: {
ctx: {
cssnext: {...options}
}
}
}
]
}
postcss.config.js
module.exports = ({ file, options, env }) => ({
parser: file.extname === '.sss' ? 'sugarss' : false,
plugins: {
'postcss-import': { root: file.dirname },
'cssnext': options.cssnext ? options.cssnext : false
'cssnano': env === 'production' ? { safe: true } : false
}
})
Options Validation Error
- index: add options validation (2b76df8)
Refactor
Syntax Error
Module Export
(JS Module)
ℹ️ This is especially useful for Angular 2 Users
webpack.config.js
{
test: /\.scss$/
- use: [ 'raw-loader', 'sass-loader' ]
+ use: [ 'postcss-loader', 'sass-loader' ]
}
BREAKING CHANGES
- Removed support for
node =< v4.0.0
(LTS) - Remove
ctx.webpack
(Loader API) => usectx.file, ctx.env, ctx.options
- Remove Plugin Presets
options.pack
- Remove webpack Plugin Hook (
postcss-loader-before-processing
) - Update to PostCSS v6.0.0
- Refactor
options.config
=> useoptions.config.path
/options.config.ctx
(ctx.options
)
webpack.config.js
{
test: /\.css$/
use: [
{
loader: 'postcss-loader',
options: {
- config: 'path/to/postcss.config.js'
+ config: {
+ ctx: {},
+ path: 'path/to/postcss.config.js'
+ }
}
}
]
}