From 3d227acb6a8ee19ff6136a976c6b6197f95bab8d Mon Sep 17 00:00:00 2001 From: pengbo43 Date: Fri, 13 Jan 2023 10:25:28 +0800 Subject: [PATCH 1/2] chore: enabledLibraryTypes push opt --- lib/container/ContainerPlugin.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/container/ContainerPlugin.js b/lib/container/ContainerPlugin.js index 528fad6acad..b1cd3510f3d 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); From eec7f623ce726185c63ad355d2a12d523ac25ef5 Mon Sep 17 00:00:00 2001 From: pengbo43 Date: Mon, 16 Jan 2023 10:08:24 +0800 Subject: [PATCH 2/2] chore: lint error --- lib/container/ContainerPlugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/container/ContainerPlugin.js b/lib/container/ContainerPlugin.js index b1cd3510f3d..833091047eb 100644 --- a/lib/container/ContainerPlugin.js +++ b/lib/container/ContainerPlugin.js @@ -64,7 +64,7 @@ class ContainerPlugin { const { name, exposes, shareScope, filename, library, runtime } = this._options; - if(!compiler.options.output.enabledLibraryTypes.includes(library.type)) { + if (!compiler.options.output.enabledLibraryTypes.includes(library.type)) { compiler.options.output.enabledLibraryTypes.push(library.type); }