From 4be3113049aa980131bbb2d936b01e2e05502956 Mon Sep 17 00:00:00 2001 From: Daniel Playfair Cal Date: Fri, 21 Feb 2020 09:54:24 +1100 Subject: [PATCH] fix: prevent async imports from creating chunks --- packages/haul-preset-0.60/src/defaultConfig.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/haul-preset-0.60/src/defaultConfig.ts b/packages/haul-preset-0.60/src/defaultConfig.ts index 931102ea..213b06ae 100644 --- a/packages/haul-preset-0.60/src/defaultConfig.ts +++ b/packages/haul-preset-0.60/src/defaultConfig.ts @@ -121,6 +121,15 @@ export default function getDefaultConfig( minimize: !!minify, debug: dev, }), + /** + * All chunks will be combined into a single bundle anyway - so + * combine all chunks into one to avoid creating other issues e.g. + * https://github.com/callstack/haul/issues/701. They might otherwise + * be created e.g. by calls to `import()`. + */ + new webpack.optimize.LimitChunkCountPlugin({ + maxChunks: 1, + }), ], resolve: { plugins: [