* Added webpack bundle analyzer. * Renamed to bundleAnalyzer (no extension) * Added some documentation.
21 lines
470 B
JavaScript
Executable file
21 lines
470 B
JavaScript
Executable file
#!/usr/bin/env node
|
|
|
|
/* eslint-env node */
|
|
|
|
const webpack = require('webpack');
|
|
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
const config = require('../config/webpack/production');
|
|
|
|
config.plugins.push(new BundleAnalyzerPlugin());
|
|
|
|
process.env.NODE_ENV = 'production';
|
|
|
|
const compiler = webpack(config);
|
|
|
|
compiler.run((error, stats) => {
|
|
if (error) {
|
|
throw new Error(error);
|
|
}
|
|
|
|
console.log(stats); // eslint-disable-line no-console
|
|
});
|