Skip to content

Commit 1d083ce

Browse files
committed
fix: use fileURLToPath instead of .pathname to fix unicode compatibility
Fixes vuejs#5
1 parent a984520 commit 1d083ce

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

template/base/vite.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { fileURLToPath } from 'url'
2+
13
import { defineConfig } from 'vite'
24
import vue from '@vitejs/plugin-vue'
35

@@ -6,7 +8,7 @@ export default defineConfig({
68
plugins: [vue()],
79
resolve: {
810
alias: {
9-
'@/': new URL('./src/', import.meta.url).pathname
11+
'@/': fileURLToPath(new URL('./src/', import.meta.url))
1012
}
1113
}
1214
})

template/config/jsx/vite.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { fileURLToPath } from 'url'
2+
13
import { defineConfig } from 'vite'
24
import vue from '@vitejs/plugin-vue'
35
import vueJsx from '@vitejs/plugin-vue-jsx'
@@ -7,7 +9,7 @@ export default defineConfig({
79
plugins: [vue(), vueJsx()],
810
resolve: {
911
alias: {
10-
'@/': new URL('./src/', import.meta.url).pathname
12+
'@/': fileURLToPath(new URL('./src/', import.meta.url))
1113
}
1214
}
1315
})

0 commit comments

Comments
 (0)