From 56c5378939c6498d0440b3ed76a604523678073f Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Tue, 11 Oct 2016 17:15:06 +0800 Subject: Optimize viz.js async rendering through webpack chunk --- webpackBaseConfig.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'webpackBaseConfig.js') diff --git a/webpackBaseConfig.js b/webpackBaseConfig.js index 6d99381c..e2d58f4d 100644 --- a/webpackBaseConfig.js +++ b/webpackBaseConfig.js @@ -17,9 +17,10 @@ module.exports = { }), new ExtractTextPlugin("[name].css"), new webpack.optimize.CommonsChunkPlugin({ - name: "vendor", - filename: "vendor.bundle.js", - minChunks: Infinity, + name: ["vendor", "public", "slide", "locale"], + async: true, + filename: '[name].js', + minChunks: Infinity }) ], @@ -33,9 +34,12 @@ module.exports = { "jquery-textcomplete", "jquery-mousewheel", "jquery-scrollspy/jquery-scrollspy", + "jquery-ui/ui/widgets/resizable", + "jquery-ui/ui/widgets/tooltip", + "jquery-ui/ui/widgets/controlgroup", + "jquery-ui/ui/widgets/autocomplete", "expose?LZString!lz-string", "expose?filterXSS!xss", - "expose?Viz!viz.js", "js-url", "bootstrap" ] @@ -43,6 +47,7 @@ module.exports = { output: { path: path.join(__dirname, 'public/build'), + publicPath: '/build/', filename: '[name].js' }, @@ -51,10 +56,7 @@ module.exports = { path.resolve(__dirname, 'src'), path.resolve(__dirname, 'node_modules') ], - extensions: ["", ".js"], - alias: { - 'jquery-ui': 'jquery-ui/ui/widgets' - } + extensions: ["", ".js"] }, module: { -- cgit v1.2.3