add analyse script

This commit is contained in:
casperlamboo 2018-01-18 11:40:57 +01:00
parent bbd8bc529d
commit 46408e0668
3 changed files with 253 additions and 1792 deletions

2032
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -8,6 +8,7 @@
"scripts": {
"start": "webpack-dev-server -w",
"prepare": "npm run build",
"analyze": "ANALYZE_BUNDLE=true webpack -p",
"build": "npm run build:main && npm run build:main:settings && npm run build:module && npm run build:module:settings ",
"build:main": "BABEL_ENV=main babel src -s -d lib",
"build:module": "BABEL_ENV=module babel src -s -d module",
@ -31,7 +32,8 @@
"react-jss": "^7.2.0",
"react-resize-detector": "^1.1.0",
"shortid": "^2.2.8",
"three": "^0.88.0"
"three": "^0.88.0",
"webpack-bundle-analyzer": "^2.9.2"
},
"devDependencies": {
"babel-cli": "6.24.1",

View File

@ -1,8 +1,9 @@
const path = require('path');
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const HTMLWebpackPlugin = require('html-webpack-plugin');
const devMode = true;
const devMode = process.env.NODE_ENV !== 'production';
const analyzeBundle = process.env.ANALYZE_BUNDLE;
const babelLoader = {
loader: 'babel-loader',
@ -61,13 +62,13 @@ module.exports = {
}
]
},
plugins: [
plugins: analyzeBundle ? [new BundleAnalyzerPlugin()] : [
new HTMLWebpackPlugin({
title: 'Doodle3D Slicer',
template: require('html-webpack-template'),
inject: false,
appMountId: 'app'
}),
})
],
devtool: "source-map",
devServer: {