Add package size profiling tools
parent
c21e1402b6
commit
4f9320a51f
|
@ -1,2 +1,3 @@
|
|||
dist/report.html
|
||||
scripts/
|
||||
.*
|
||||
|
|
14
package.json
14
package.json
|
@ -47,8 +47,10 @@
|
|||
"react": "^15.5.4",
|
||||
"react-dom": "^15.5.4",
|
||||
"rimraf": "2.5.2",
|
||||
"size-limit": "^0.10.0",
|
||||
"svg-jsx-loader": "^0.0.16",
|
||||
"webpack": "1.12.14"
|
||||
"webpack": "1.12.14",
|
||||
"webpack-bundle-analyzer": "^2.9.0"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf data/ dist/",
|
||||
|
@ -61,7 +63,13 @@
|
|||
"react:clean": "rimraf node_modules/{react,react-dom,react-addons-test-utils}",
|
||||
"react:14": "npm run react:clean && npm i react@^0.14 react-dom@^0.14 react-addons-test-utils@^0.14 --save-dev",
|
||||
"react:15": "npm run react:clean && npm i react@^15 react-dom@^15 react-addons-test-utils@^15 --save-dev",
|
||||
"test": "NODE_ENV=test ./node_modules/karma/bin/karma start",
|
||||
"test": "NODE_ENV=test karma start && size-limit",
|
||||
"prepublish": "npm run clean && npm run build"
|
||||
}
|
||||
},
|
||||
"size-limit": [
|
||||
{
|
||||
"path": "dist/emoji-mart.js",
|
||||
"limit": "110 KB"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
var path = require('path')
|
||||
var pack = require('../package.json')
|
||||
var webpack = require('webpack')
|
||||
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
|
||||
var PROD = process.env.NODE_ENV === 'production';
|
||||
var TEST = process.env.NODE_ENV === 'test';
|
||||
|
@ -52,6 +53,7 @@ module.exports = {
|
|||
new webpack.DefinePlugin({
|
||||
EMOJI_DATASOURCE_VERSION: `'${pack.devDependencies['emoji-datasource']}'`,
|
||||
}),
|
||||
new BundleAnalyzerPlugin({ analyzerMode: 'static', openAnalyzer: false })
|
||||
],
|
||||
|
||||
bail: true,
|
||||
|
|
Loading…
Reference in New Issue