In Webpack, I have the following plugins:
plugins: [
new ExtractTextPlugin(\'styles.css\'),
new webpack.optimize.UglifyJsPlugin({
com
I push onto the plugins array given a condition in my webpack.config.js
var webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: {
...
},
output: {
...
},
module: {
rules: [
...
]
},
plugins: [
new ExtractTextPlugin('styles.css'),
]
};
if (TARGET === 'build') {
module.exports.plugins.push(
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
drop_console: true,
}),
);
}