Skip to content

Commit

Permalink
feat:enable-optimizeDeps.esbuildOptions.loader
Browse files Browse the repository at this point in the history
enable respect `optimizeDeps.esbuildOptions.loader` option so that the map of js types to loader could be customized, relevant issue: #3448
  • Loading branch information
dickeylth authored and 弘树 committed Feb 10, 2022
1 parent 3949d21 commit 7973ea4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vite/src/node/optimizer/scan.ts
Expand Up @@ -433,8 +433,9 @@ function esbuildScanPlugin(
})
)
}
const { loader } = config.optimizeDeps?.esbuildOptions ?? {}
return {
loader: ext as Loader,
loader: ((loader && loader[`.${ext}`]) || ext) as Loader,
contents
}
})
Expand Down

0 comments on commit 7973ea4

Please sign in to comment.