Minimize doesn't seem to have the parameters you are trying to call it with:
By default the css-loader minimizes the css if specified by the module system.
In some cases the minification is destructive to the css, so you can provide some options to it. cssnano is used for minification and you find a list of options here.
You can also disable or enforce minification with the minimize query parameter.
{
test: /\.css$/,
use: [
{
loader: 'css-loader',
options: {
minimize: true || {/* CSSNano Options */}
}
}
]
}
Inside your ExtractTextPlugin.extract()
, you shouldn't use loader
and options
, but rather use
, fallback
and publicPath
(see docu).
The use
parameter takes the same parameters as the use
parameter of the loader itself, so in the end you should get something like:
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback : 'style-loader',
use : {
loader: 'css-loader',
options: {
minimize: true || {/* CSSNano Options */}
}
}
})
}
See https://github.com/webpack-contrib/css-loader
See https://github.com/webpack-contrib/extract-text-webpack-plugin