Added webpack-bundle-analyzer

This commit is contained in:
orangemug 2017-11-07 11:48:01 +00:00
parent f452ea0d26
commit 392d1fe26d
2 changed files with 11 additions and 1 deletions

View file

@ -5,6 +5,7 @@ var loaders = require('./webpack.loaders');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var WebpackCleanupPlugin = require('webpack-cleanup-plugin');
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
var OUTPATH;
if(process.env.CIRCLE_ARTIFACTS) {
@ -79,6 +80,14 @@ module.exports = {
template: './src/template.html',
title: 'Maputnik'
}),
new webpack.optimize.DedupePlugin()
new webpack.optimize.DedupePlugin(),
new BundleAnalyzerPlugin({
analyzerMode: 'static',
defaultSizes: 'gzip',
openAnalyzer: false,
generateStatsFile: true,
reportFilename: 'bundle-stats.html',
statsFilename: 'bundle-stats.json',
}),
]
};

View file

@ -125,6 +125,7 @@
"wdio-spec-reporter": "^0.1.2",
"webdriverio": "^4.8.0",
"webpack": "^3.8.1",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-cleanup-plugin": "^0.5.1",
"webpack-dev-server": "^2.9.4"
}