"scripts": {
"start": "cross-env NODE_ENV=development webpack serve --config webpack/webpack.config.babel.js --mode development"
}
const isDev = process.env.NODE_ENV === 'development';
const isProd = !isDev;
if (isProd) {
// Используем PurgeCSS.
}
const config = {
entry: './src/index.js',
output: {
// ...
},
module: {
// ...
},
plugins: [
new MiniCssExtractPlugin({
filename: 'assets/css/style.css'
}),
// ...
]
};
if (isDev) {
config.plugins.push( new PurgecssPlugin() );
}
module.exports = config;