Skip to content

Commit 5cfede1

Browse files
committed
bundle analyzer only in dev config
1 parent 6aabf8a commit 5cfede1

4 files changed

+7
-5
lines changed

.babelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"presets": ["react"],
3-
"plugins": ["lodash", "babel-plugin-transform-object-rest-spread", "syntax-dynamic-import", "react-hot-loader/babel"],
3+
"plugins": ["lodash", "babel-plugin-transform-object-rest-spread", "syntax-dynamic-import"],
44
"env": {
55
"production": {
66
"presets": ["env"],

webpack.common.js

-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
const path = require('path');
33
const webpack = require('webpack');
44
const ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin');
5-
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
65
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
76

87
const publicPath = '/libsvm/';
@@ -78,7 +77,6 @@ module.exports = {
7877
},
7978
plugins: [
8079
new LodashModuleReplacementPlugin(),
81-
new BundleAnalyzerPlugin(),
8280
new webpack.LoaderOptionsPlugin({
8381
options: {
8482
worker: {

webpack.config.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
'use strict';
22

3-
const webpack = require('webpack');
3+
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
44
const webpackConfig = require('./webpack.common');
55
const port = 3000;
66

7-
87
webpackConfig.devtool = 'inline-source-map';
98

9+
webpackConfig.plugins = webpackConfig.plugins.concat([
10+
new BundleAnalyzerPlugin(),
11+
]);
12+
1013
webpackConfig.devServer = {
1114
inline: true,
1215
historyApiFallback: true,

webpack.production.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
const webpackConfig = require('./webpack.common');
2+
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
23

34
module.exports = webpackConfig;

0 commit comments

Comments
 (0)