Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
new HtmlWebpackPlugin({ template: 'index.html' }),
new CompressionPlugin(),
new FileManagerPlugin({
onEnd: {
copy: [
{ source: 'dist/*.js', destination: 'docs' },
{ source: 'dist/*.woff2', destination: 'docs' },
],
},
}),
];
if (process.env.NODE_ENV === 'production') {
console.log('BUILDING FOR PRODUCTION ... '); // eslint-disable-line no-console
commonPlugins.push(new BundleAnalyzerPlugin({ analyzerMode: 'static' }));
commonPlugins.push(new DuplicatesPlugin({ emitErrors: false, verbose: true }));
}
module.exports = {
entry: './src/index.js',
node: { fs: 'empty' },
externals: {
esprima: 'esprima',
'native-promise-only': 'native-promise-only',
commander: 'commander',
yargs: 'yargs',
},
optimization: {
splitChunks: {
chunks: 'all',
},
},
new HtmlWebpackPlugin({template: 'index.html'}),
new CleanWebpackPlugin(),
new CompressionPlugin(),
new FileManagerPlugin({
onEnd: {
copy: [
{ source: 'dist/*.js', destination: 'docs' },
],
},
}),
];
if (process.env.NODE_ENV === 'production') {
console.log('BUILDING FOR PRODUCTION ... ');
commonPlugins.push(new BundleAnalyzerPlugin({ analyzerMode:'static' }));
commonPlugins.push(new DuplicatesPlugin({ emitErrors: false, verbose: true }));
}
module.exports = {
entry: './src/index.js',
node: { fs: 'empty' },
externals: {
esprima: 'esprima',
commander: 'commander',
'native-promise-only':'native-promise-only',
yargs: 'yargs',
},
optimization: {
splitChunks: {
chunks: 'all',
},