Skip to content

Commit 1bee148

Browse files
fix: normalize path in data-v-inspector attribute (#60)
1 parent 956865d commit 1bee148

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/src/compiler/template.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import vueJsxPlugin from '@vue/babel-plugin-jsx'
66
import typescriptPlugin from '@babel/plugin-transform-typescript'
77
import importMeta from '@babel/plugin-syntax-import-meta'
88
import { parseJSXIdentifier } from '../utils'
9+
import { normalizePath } from 'vite'
910

1011
const EXCLUDE_TAG = ['template', 'script', 'style']
1112
const KEY_DATA = 'data-v-inspector'
@@ -19,7 +20,7 @@ export async function compileSFCTemplate(
1920
{ code, id, type }: CompileSFCTemplateOptions,
2021
) {
2122
const s = new MagicString(code)
22-
const relativePath = path.relative(process.cwd(), id)
23+
const relativePath = normalizePath(path.relative(process.cwd(), id))
2324
const result = await new Promise((resolve) => {
2425
switch (type) {
2526
case 'template': {

0 commit comments

Comments
 (0)