Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
chunks: 'all',
enforce: true,
},
},
},
minimizer: [
new TerserPlugin({
parallel: true,
terserOptions: {
ie8: false,
output: {
comments: false,
},
},
}),
new CssoWebpackPlugin({ restructure: false }),
],
},
plugins: [
new webpack.IgnorePlugin(/^electron$/),
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: '[name].bundle.css',
chunkFilename: '[id].bundle.css',
}),
// new WriteFilePlugin()
],
resolve: {
modules: ['node_modules'],
symlinks: false,
cacheWithContext: false,
};
if(ENV === 'development') {
config.devtool = 'source-map';
}
if(ENV === 'production') {
config.entry['js/dist/imageset.min.js'] = './assets/js/src/imageset.js';
config.entry['js/dist/respimage.min.js'] = './assets/js/src/respimage.js';
config.plugins.push(new UglifyJsPlugin({
include: /\.min\.js$/,
}));
config.plugins.push(new CssoWebpackPlugin({
pluginOutputPostfix: 'min',
}));
}
module.exports = config;