Skip to content

Commit

Permalink
fix: loader may be undefined
Browse files Browse the repository at this point in the history
incase typescript check
  • Loading branch information
dickeylth committed Feb 10, 2022
1 parent f6b2d4f commit 12bb3ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/optimizer/scan.ts
Expand Up @@ -435,7 +435,7 @@ function esbuildScanPlugin(
}
const { loader } = config.optimizeDeps?.esbuildOptions ?? {}
return {
loader: loader[`.${ext}`] || ext as Loader,
loader: (loader && loader[`.${ext}`]) || ext as Loader,
contents
}
})
Expand Down

0 comments on commit 12bb3ba

Please sign in to comment.