Skip to content
This repository has been archived by the owner on Jan 31, 2019. It is now read-only.

Commit

Permalink
将babel-polyfill改为transform-runtime,vendor.js减小了 200kb
Browse files Browse the repository at this point in the history
  • Loading branch information
hyy1115 committed Jul 8, 2017
1 parent 3852fcd commit 5f461fe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"presets": ["es2015", "stage-3", "react"]
}
},
"plugins": ["react-hot-loader/babel"]
"plugins": [
"react-hot-loader/babel",
"transform-runtime"
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"devDependencies": {
"babel-core": "6.24.1",
"babel-loader": "^6.2.10",
"babel-polyfill": "6.23.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-3": "^6.17.0",
Expand Down
3 changes: 1 addition & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ HashBundlePlugin.prototype.apply = (compiler) => {
};

const config = {
entry: ['babel-polyfill', path.resolve(__dirname, 'src')],
entry: [path.resolve(__dirname, 'src')],
output: {
filename: `${isProd ? '[hash].' : ''}[name].js`,
path: path.resolve(__dirname, 'build'),
Expand Down Expand Up @@ -113,7 +113,6 @@ if (!isProd) {
'react-hot-loader/patch',
`webpack-dev-server/client?http://${config.devServer.host}:${config.devServer.port}`,
'webpack/hot/only-dev-server', // "only" prevents reload on syntax errors
'babel-polyfill',
path.resolve(__dirname, 'src'),
];

Expand Down

0 comments on commit 5f461fe

Please sign in to comment.