Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions packages/vite/src/node/__tests__/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,24 @@ describe('mergeConfig', () => {
})

test('handles ssr.noExternal', () => {
const baseConfig = {
const baseConfig: UserConfig = {
ssr: {
noExternal: true,
external: true,
},
}

const newConfig = {
const newConfig: UserConfig = {
ssr: {
noExternal: ['foo'],
external: ['bar'],
},
}

const mergedConfig = {
const mergedConfig: UserConfig = {
ssr: {
noExternal: true,
external: true,
},
}

Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ function mergeConfigRecursively(
merged[key] = [].concat(existing, value)
continue
} else if (
((key === 'noExternal' &&
(((key === 'noExternal' || key === 'external') &&
(rootPath === 'ssr' || rootPath === 'resolve')) ||
(key === 'allowedHosts' && rootPath === 'server')) &&
(existing === true || value === true)
Expand Down
Loading