Answer the question
In order to leave comments, you need to log in
How to generate two css files in Webpack (minified and not)?
There is a task to configure the webpack assembly to create two css files (minified and normal). I can't figure out how to do it. It is necessary to generate two output files from the same css input files.
Now it looks like this for me:
module.exports = {
...
plugins: [
...
new MiniCssExtractPlugin({
filename: (isProd) ? '[name].css' : '[name].[contenthash].css'
}),
...
],
module: {
rules: [
{
test: /\.(sa|sc|c)ss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
hmr: isDev,
reloadAll: true,
},
},
'css-loader',
'postcss-loader',
'sass-loader',
'webpack-import-glob-loader'
]
},
...
]
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question