From c76322c40de79f7c009687eaa894229cc8cd9ed0 Mon Sep 17 00:00:00 2001 From: d98762625 Date: Mon, 11 Feb 2019 17:21:16 +0000 Subject: [PATCH] force webpack to only emit one file when using dynamic import --- Gruntfile.js | 15 ++++++++++++--- package-lock.json | 5 +++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 48af8ea6..e2de1d9d 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -288,7 +288,10 @@ module.exports = function (grunt) { libraryTarget: "commonjs2" }, plugins: [ - new webpack.DefinePlugin(BUILD_CONSTANTS) + new webpack.DefinePlugin(BUILD_CONSTANTS), + new webpack.optimize.LimitChunkCountPlugin({ + maxChunks: 1 + }) ], }, nodeProd: { @@ -305,7 +308,10 @@ module.exports = function (grunt) { libraryTarget: "commonjs2" }, plugins: [ - new webpack.DefinePlugin(BUILD_CONSTANTS) + new webpack.DefinePlugin(BUILD_CONSTANTS), + new webpack.optimize.LimitChunkCountPlugin({ + maxChunks: 1 + }) ], optimization: { minimizer: [ @@ -333,7 +339,10 @@ module.exports = function (grunt) { libraryTarget: "commonjs2" }, plugins: [ - new webpack.DefinePlugin(BUILD_CONSTANTS) + new webpack.DefinePlugin(BUILD_CONSTANTS), + new webpack.optimize.LimitChunkCountPlugin({ + maxChunks: 1 + }) ], optimization: { minimizer: [ diff --git a/package-lock.json b/package-lock.json index c8b30ab1..bba0c2c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -780,6 +780,11 @@ "regenerator-runtime": "^0.12.0" }, "dependencies": { + "core-js": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.4.tgz", + "integrity": "sha512-05qQ5hXShcqGkPZpXEFLIpxayZscVD2kuMBZewxiIPPEagukO4mqgPA9CWhUvFBJfy3ODdK2p9xyHh7FTU9/7A==" + }, "regenerator-runtime": { "version": "0.12.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz",