From 3852fcde949d116a0e319aaaea3959c84bc7405e Mon Sep 17 00:00:00 2001 From: yongyuehuang <1130216245@qq.com> Date: Sat, 8 Jul 2017 10:27:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=8F=B0=E7=9A=84chunks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webpack.config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index 8c593fc..e0de1d9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -99,6 +99,9 @@ const config = { host: 'localhost', port: Number(process.env.PORT) || 8080, historyApiFallback: true, + stats: { + chunks: false + } }, }; From 5f461fec252f60209f8f2384319c3af608f4375e Mon Sep 17 00:00:00 2001 From: yongyuehuang <1130216245@qq.com> Date: Sat, 8 Jul 2017 11:08:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=B0=86babel-polyfill=E6=94=B9=E4=B8=BAtr?= =?UTF-8?q?ansform-runtime=EF=BC=8Cvendor.js=E5=87=8F=E5=B0=8F=E4=BA=86=20?= =?UTF-8?q?200kb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .babelrc | 5 ++++- package.json | 2 +- webpack.config.js | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.babelrc b/.babelrc index c339307..0a3d56b 100644 --- a/.babelrc +++ b/.babelrc @@ -5,5 +5,8 @@ "presets": ["es2015", "stage-3", "react"] } }, - "plugins": ["react-hot-loader/babel"] + "plugins": [ + "react-hot-loader/babel", + "transform-runtime" + ] } diff --git a/package.json b/package.json index cb44776..95dbccb 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/webpack.config.js b/webpack.config.js index e0de1d9..156e096 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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'), @@ -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'), ];