1
0
Fork 0
mirror of https://github.com/webpack/webpack.git synced 2024-06-19 02:05:28 +02:00

fix: esm with splitChunks

This commit is contained in:
alexander.akait 2023-04-18 17:50:24 +03:00
parent 8ce07a13b7
commit 57cdb411b1

View file

@ -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 => {