Skip to content

Commit 8c99c72

Browse files
committed
perf(package): add babel react optimization plugins
1 parent 2451875 commit 8c99c72

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.babelrc

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@
55
"stage-1"
66
],
77
"plugins": [
8-
"lodash"
8+
"lodash",
9+
"transform-react-constant-elements",
10+
["transform-react-remove-prop-types", {
11+
"mode": "wrap"
12+
}],
13+
["transform-runtime", {
14+
"polyfill": false,
15+
"regenerator": false
16+
}]
917
],
1018
"env": {
1119
"development": {

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@
5656
"babel-plugin-__coverage__": "^11.0.0",
5757
"babel-plugin-lodash": "^3.1.4",
5858
"babel-plugin-react-transform": "^2.0.2",
59+
"babel-plugin-transform-react-constant-elements": "^6.9.1",
60+
"babel-plugin-transform-runtime": "^6.15.0",
5961
"babel-preset-es2015": "^6.18.0",
6062
"babel-preset-react": "^6.5.0",
6163
"babel-preset-stage-1": "^6.5.0",
6264
"babel-register": "^6.18.0",
65+
"babel-runtime": "^6.18.0",
6366
"babel-standalone": "^6.18.0",
6467
"brace": "^0.8.0",
6568
"chai": "^3.5.0",

webpack.umd.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ const webpackUMDConfig = {
2222
externals: {
2323
react: 'React',
2424
'react-dom': 'ReactDOM',
25-
Babel: 'babel-standalone',
2625
},
2726
plugins: [
27+
new webpack.DefinePlugin(config.compiler_globals),
2828
new webpack.optimize.OccurrenceOrderPlugin(),
2929
new webpack.optimize.DedupePlugin(),
3030
new webpack.optimize.UglifyJsPlugin({

0 commit comments

Comments
 (0)