Ignore moment.js locales for smaller build

This commit is contained in:
Eliot Berriot 2018-12-19 22:22:51 +01:00
parent 7c8fc72f49
commit c6e03b15c7
No known key found for this signature in database
GPG Key ID: DD6965E2476E5C27
1 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,11 @@
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
let plugins = []
const webpack = require('webpack');
let plugins = [
// do not include moment.js locales since it's quite heavy
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
]
if (process.env.BUNDLE_ANALYZE === '1') {
plugins.push(new BundleAnalyzerPlugin())
}