From 57cdb411b1a5209cb49b9eb9f065d9cb86a579e7 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Tue, 18 Apr 2023 17:50:24 +0300 Subject: [PATCH] fix: esm with splitChunks --- lib/esm/ModuleChunkLoadingPlugin.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/esm/ModuleChunkLoadingPlugin.js b/lib/esm/ModuleChunkLoadingPlugin.js index 5c984a596..6bbd76ebb 100644 --- a/lib/esm/ModuleChunkLoadingPlugin.js +++ b/lib/esm/ModuleChunkLoadingPlugin.js @@ -8,6 +8,7 @@ const RuntimeGlobals = require("../RuntimeGlobals"); const ExportWebpackRequireRuntimeModule = require("./ExportWebpackRequireRuntimeModule"); const ModuleChunkLoadingRuntimeModule = require("./ModuleChunkLoadingRuntimeModule"); +const StartupChunkDependenciesPlugin = require("../runtime/StartupChunkDependenciesPlugin"); /** @typedef {import("../Compiler")} Compiler */ @@ -18,6 +19,10 @@ class ModuleChunkLoadingPlugin { * @returns {void} */ apply(compiler) { + new StartupChunkDependenciesPlugin({ + chunkLoading: "import", + asyncChunkLoading: true + }).apply(compiler); compiler.hooks.thisCompilation.tap( "ModuleChunkLoadingPlugin", compilation => {