From f3fcb8223ee42ba6912e5211ba4dd44e959244fb Mon Sep 17 00:00:00 2001 From: Joel Denning Date: Tue, 17 Dec 2024 21:16:54 -0700 Subject: [PATCH] Disable standalone mode unless explicitly set (#431) --- .changeset/tasty-knives-compete.md | 5 +++++ .../lib/webpack-config-single-spa.js | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .changeset/tasty-knives-compete.md diff --git a/.changeset/tasty-knives-compete.md b/.changeset/tasty-knives-compete.md new file mode 100644 index 0000000..28fbbe8 --- /dev/null +++ b/.changeset/tasty-knives-compete.md @@ -0,0 +1,5 @@ +--- +"webpack-config-single-spa": major +--- + +Disable standalone mode unless explicitly set diff --git a/packages/webpack-config-single-spa/lib/webpack-config-single-spa.js b/packages/webpack-config-single-spa/lib/webpack-config-single-spa.js index 0c27f97..c2b5026 100644 --- a/packages/webpack-config-single-spa/lib/webpack-config-single-spa.js +++ b/packages/webpack-config-single-spa/lib/webpack-config-single-spa.js @@ -32,7 +32,10 @@ function webpackConfigSingleSpa(opts) { let argv = opts.argv || {}; - let isProduction = argv.p || argv.mode === "production"; + let isProduction = + argv.p || argv.mode === "production" || webpackConfigEnv.WEBPACK_BUILD; + + const isStandalone = webpackConfigEnv.standalone; let HtmlWebpackPlugin = opts.HtmlWebpackPlugin || _HtmlWebpackPlugin; @@ -135,7 +138,7 @@ function webpackConfigSingleSpa(opts) { rootDirectoryLevel: opts.rootDirectoryLevel, }), !isProduction && !opts.disableHtmlGeneration && new HtmlWebpackPlugin(), - !isProduction && + isStandalone && !opts.disableHtmlGeneration && new StandaloneSingleSpaPlugin({ appOrParcelName: `@${opts.orgName}/${opts.projectName}`,