diff --git a/packages/playground/ssr-webworker/vite.config.js b/packages/playground/ssr-webworker/vite.config.js index 80cc1784cdc565..91a0571380608e 100644 --- a/packages/playground/ssr-webworker/vite.config.js +++ b/packages/playground/ssr-webworker/vite.config.js @@ -10,9 +10,18 @@ module.exports = { }, ssr: { target: 'webworker', - noExternal: true + noExternal: ['this-should-be-replaced-by-the-boolean'] }, plugins: [ + { + config() { + return { + ssr: { + noExternal: true + } + } + } + }, { config() { return { diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index 556fcf7cbae77a..d242ac632c220e 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -745,7 +745,8 @@ function mergeConfigRecursively( } else if (key === 'assetsInclude' && rootPath === '') { merged[key] = [].concat(existing, value) continue - } else if (key === 'noExternal' && existing === true) { + } else if (key === 'noExternal' && (existing === true || value === true)) { + merged[key] = true continue }