Skip to content

Commit 5c02ef5

Browse files
committed
Revert "fix: lazily evaluate __vite__mapDeps files (vitejs#17602)"
This reverts commit dafff4a.
1 parent 2883fb5 commit 5c02ef5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/vite/src/node/plugins/importAnalysisBuild.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {
659659
)
660660
.join(',')}]`
661661

662-
const mapDepsCode = `const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=${fileDepsCode})))=>i.map(i=>d[i]);\n`
662+
const mapDepsCode = `const __vite__fileDeps=${fileDepsCode},__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);\n`
663663

664664
// inject extra code at the top or next line of hashbang
665665
if (code.startsWith('#!')) {

playground/js-sourcemap/__tests__/js-sourcemap.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ describe.runIf(isBuild)('build tests', () => {
164164
const js = findAssetFile(/after-preload-dynamic-hashbang-[-\w]{8}\.js$/)
165165
expect(js.split('\n').slice(0, 2)).toEqual([
166166
'#!/usr/bin/env node',
167-
expect.stringContaining('const __vite__mapDeps=(i'),
167+
expect.stringContaining('const __vite__fileDeps=['),
168168
])
169169
})
170170

0 commit comments

Comments
 (0)