From 85c9496340668ad2ebd04eea57d669f82b7dbaf1 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Tue, 16 May 2017 03:20:10 +0900 Subject: Introduce common JavaScript file (#2981) * Create common chunk rather than vendor chunk vendor chunk is a set of modules provided by external vendors, but now we can have a chunk as a set of modules shared by multiple entry points, which could be more efficent than having vendor chunk. * Start rails-ujs in common.js This is used by /settings/two_factor_authentication. --- config/webpack/shared.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config/webpack/shared.js') diff --git a/config/webpack/shared.js b/config/webpack/shared.js index ef9feaeba..008218808 100644 --- a/config/webpack/shared.js +++ b/config/webpack/shared.js @@ -40,8 +40,8 @@ module.exports = { new ExtractTextPlugin(env.NODE_ENV === 'production' ? '[name]-[hash].css' : '[name].css'), new ManifestPlugin({ fileName: paths.manifest, publicPath, writeToFileEmit: true }), new webpack.optimize.CommonsChunkPlugin({ - name: 'vendor', - minChunks: ({ resource }) => /node_modules/.test(resource) + name: 'common', + minChunks: 2 }) ], -- cgit