]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
fix: use `fileURLToPath` instead of `.pathname` to fix unicode compatibility
authorHaoqun Jiang <haoqunjiang@gmail.com>
Wed, 24 Nov 2021 11:00:06 +0000 (19:00 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Wed, 24 Nov 2021 11:00:06 +0000 (19:00 +0800)
Fixes #5

template/base/vite.config.js
template/config/jsx/vite.config.js

index 24c2e504741f170ece3d9b0eb26670c3d7c90ecd..6ff2d33a296373976240761ba35755b44644f3d2 100644 (file)
@@ -1,3 +1,5 @@
+import { fileURLToPath } from 'url'
+
 import { defineConfig } from 'vite'
 import vue from '@vitejs/plugin-vue'
 
@@ -6,7 +8,7 @@ export default defineConfig({
   plugins: [vue()],
   resolve: {
     alias: {
-      '@/': new URL('./src/', import.meta.url).pathname
+      '@/': fileURLToPath(new URL('./src/', import.meta.url))
     }
   }
 })
index 032e163cf57f312792c106d417534e89491a0727..5be11429b59a890e621b08c83c6b61f4d203eb90 100644 (file)
@@ -1,3 +1,5 @@
+import { fileURLToPath } from 'url'
+
 import { defineConfig } from 'vite'
 import vue from '@vitejs/plugin-vue'
 import vueJsx from '@vitejs/plugin-vue-jsx'
@@ -7,7 +9,7 @@ export default defineConfig({
   plugins: [vue(), vueJsx()],
   resolve: {
     alias: {
-      '@/': new URL('./src/', import.meta.url).pathname
+      '@/': fileURLToPath(new URL('./src/', import.meta.url))
     }
   }
 })