From: Haoqun Jiang Date: Wed, 24 Nov 2021 11:00:06 +0000 (+0800) Subject: fix: use `fileURLToPath` instead of `.pathname` to fix unicode compatibility X-Git-Tag: v3.0.0-beta.7~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d083ce26944537cc5e042d583ac3c8d4bf20942;p=thirdparty%2Fvuejs%2Fcreate-vue.git fix: use `fileURLToPath` instead of `.pathname` to fix unicode compatibility Fixes #5 --- diff --git a/template/base/vite.config.js b/template/base/vite.config.js index 24c2e504..6ff2d33a 100644 --- a/template/base/vite.config.js +++ b/template/base/vite.config.js @@ -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)) } } }) diff --git a/template/config/jsx/vite.config.js b/template/config/jsx/vite.config.js index 032e163c..5be11429 100644 --- a/template/config/jsx/vite.config.js +++ b/template/config/jsx/vite.config.js @@ -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)) } } })