Add package size profiling tools

release
Andrey Sitnik 2017-08-16 15:33:24 -07:00
parent c21e1402b6
commit 4f9320a51f
4 changed files with 2083 additions and 44 deletions

View File

@ -1,2 +1,3 @@
dist/report.html
scripts/
.*

View File

@ -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"
}
]
}

View File

@ -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,

2110
yarn.lock

File diff suppressed because it is too large Load Diff