8000 refactor: use normalizePath from vite · unplugin/unplugin-vue@f9b6339 · GitHub
[go: up one dir, main page]

Skip to content

Commit f9b6339

Browse files
committed
refactor: use normalizePath from vite
ref: vitejs/vite-plugin-vue@2848174
1 parent e99fe25 commit f9b6339

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/utils/descriptorCache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createHash } from 'node:crypto'
22
import fs from 'node:fs'
33
import path from 'node:path'
4-
import slash from 'slash'
4+
import { normalizePath } from 'vite'
55
import type { ResolvedOptions, VueQuery } from '..'
66
import type { CompilerError, SFCDescriptor } from 'vue/compiler-sfc'
77

@@ -33,7 +33,7 @@ export function createDescriptor(
3333

3434
// ensure the path is normalized in a way that is consistent inside
3535
// project (relative to root) and on different systems.
36-
const normalizedPath = slash(path.normalize(path.relative(root, filename)))
36+
const normalizedPath = normalizePath(path.relative(root, filename))
3737
descriptor.id = getHash(normalizedPath + (isProduction ? source : ''))
3838
;(hmr ? hmrCache : cache).set(filename, descriptor)
3939
return { descriptor, errors }

0 commit comments

Comments
 (0)
0