Skip to content

Commit 9b98dcb

Browse files
authored
fix(module-runner): expose normalizeModuleId (vitejs#20277)
1 parent a5799fa commit 9b98dcb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/vite/src/module-runner/evaluatedModules.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ const prefixedBuiltins = new Set([
139139
// /root/id.js -> /id.js
140140
// C:/root/id.js -> /id.js
141141
// C:\root\id.js -> /id.js
142-
function normalizeModuleId(file: string): string {
142+
export function normalizeModuleId(file: string): string {
143143
if (prefixedBuiltins.has(file)) return file
144144

145145
// unix style, but Windows path still starts with the drive letter to check the root

packages/vite/src/module-runner/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// this file should re-export only things that don't rely on Node.js or other runner features
22

3-
export { EvaluatedModules, type EvaluatedModuleNode } from './evaluatedModules'
3+
export {
4+
EvaluatedModules,
5+
normalizeModuleId,
6+
type EvaluatedModuleNode,
7+
} from './evaluatedModules'
48
export { ModuleRunner } from './runner'
59
export { ESModulesEvaluator } from './esmEvaluator'
610

0 commit comments

Comments
 (0)