diff --git a/lib/container/ContainerPlugin.js b/lib/container/ContainerPlugin.js index 528fad6acad..833091047eb 100644 --- a/lib/container/ContainerPlugin.js +++ b/lib/container/ContainerPlugin.js @@ -64,7 +64,9 @@ class ContainerPlugin { const { name, exposes, shareScope, filename, library, runtime } = this._options; - compiler.options.output.enabledLibraryTypes.push(library.type); + if (!compiler.options.output.enabledLibraryTypes.includes(library.type)) { + compiler.options.output.enabledLibraryTypes.push(library.type); + } compiler.hooks.make.tapAsync(PLUGIN_NAME, (compilation, callback) => { const dep = new ContainerEntryDependency(name, exposes, shareScope);