Skip to content

Commit

Permalink
refactor: use global __vite__fileDeps
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Oct 9, 2023
1 parent 435ced3 commit 1ca5017
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/vite/src/node/plugins/importAnalysisBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,11 +642,9 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {
.join(',')}]`

s.append(`\
const __vite__fileDeps = ${fileDepsCode}
function __vite__mapDeps(indexes) {
if (!__vite__mapDeps.viteFileDeps) {
__vite__mapDeps.viteFileDeps = ${fileDepsCode}
}
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
return indexes.map((i) => __vite__fileDeps[i])
}`)

// there may still be markers due to inlined dynamic imports, remove
Expand Down

0 comments on commit 1ca5017

Please sign in to comment.