Skip to content

Commit 7690700

Browse files
committed
chore: fix playground on windows
Close posva#440
1 parent 7aa4630 commit 7690700

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

playground/vite.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { fileURLToPath, URL } from 'url'
22
import { defineConfig } from 'vite'
3-
import { join } from 'node:path'
43
import Markdown from 'unplugin-vue-markdown/vite'
54
// @ts-ignore: the plugin should not be checked in the playground
65
import VueRouter from '../src/vite'
@@ -9,8 +8,6 @@ import Vue from '@vitejs/plugin-vue'
98
import AutoImport from 'unplugin-auto-import/vite'
109
import VueDevtools from 'vite-plugin-vue-devtools'
1110

12-
const __dirname = fileURLToPath(new URL('.', import.meta.url))
13-
1411
export default defineConfig({
1512
clearScreen: false,
1613
resolve: {
@@ -102,7 +99,10 @@ export default defineConfig({
10299
}
103100
},
104101
beforeWriteFiles(root) {
105-
root.insert('/from-root', join(__dirname, './src/pages/index.vue'))
102+
root.insert(
103+
'/from-root',
104+
fileURLToPath(new URL('./src/pages/index.vue', import.meta.url))
105+
)
106106
},
107107
routesFolder: [
108108
// can add multiple routes folders

0 commit comments

Comments
 (0)