From 4dba396cbebad28c10983ddbdb7bf6dcee132d6f Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 26 Jun 2017 09:04:42 +0900 Subject: [PATCH] Enable scope hoisting --- package.json | 2 +- webpack/plugins/hoist.ts | 3 +++ webpack/plugins/index.ts | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 webpack/plugins/hoist.ts diff --git a/package.json b/package.json index 69c206847..e333c8275 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "uglify-es": "3.0.20", "uglify-es-webpack-plugin": "0.0.2", "uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony", - "webpack": "2.6.1" + "webpack": "3.0.0" }, "dependencies": { "accesses": "2.5.0", diff --git a/webpack/plugins/hoist.ts b/webpack/plugins/hoist.ts new file mode 100644 index 000000000..f61133f8d --- /dev/null +++ b/webpack/plugins/hoist.ts @@ -0,0 +1,3 @@ +import * as webpack from 'webpack'; + +export default () => new webpack.optimize.ModuleConcatenationPlugin(); diff --git a/webpack/plugins/index.ts b/webpack/plugins/index.ts index 3581f61b5..99b16c2b0 100644 --- a/webpack/plugins/index.ts +++ b/webpack/plugins/index.ts @@ -1,6 +1,7 @@ const StringReplacePlugin = require('string-replace-webpack-plugin'); import constant from './const'; +import hoist from './hoist'; //import minify from './minify'; import banner from './banner'; @@ -12,7 +13,8 @@ const isProduction = env === 'production'; export default version => { const plugins = [ constant(), - new StringReplacePlugin() + new StringReplacePlugin(), + hoist() ]; /* if (isProduction) {