diff --git a/.changeset/tasty-knives-compete.md b/.changeset/tasty-knives-compete.md new file mode 100644 index 00000000..28fbbe8f --- /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 0c27f970..c2b5026a 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}`,