Skip to content

Commit

Permalink
fix(optimizer): exclude should apply to deep imports
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 29, 2021
1 parent 2309e74 commit 3c22f84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/optimizer/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ function esbuildScanPlugin(
filter: /^[\w@][^:]/
},
async ({ path: id, importer }) => {
if (exclude?.includes(id)) {
if (exclude?.some((e) => e === id || id.startsWith(e + '/'))) {
return externalUnlessEntry({ path: id })
}
if (depImports[id]) {
Expand Down

0 comments on commit 3c22f84

Please sign in to comment.