From 87a42f77f313697f8f649009661ba5f7d93c4463 Mon Sep 17 00:00:00 2001 From: Johann Schopplich Date: Mon, 6 May 2024 09:56:42 +0200 Subject: [PATCH] chore: resolve dir entry with `fileURLToPath` related: #48 --- packages/nuxt/playground/nuxt.config.ts | 3 ++- packages/react/playground/vite.config.ts | 3 ++- packages/solid/playground/vite.config.ts | 3 ++- packages/svelte/vite.config.ts | 3 ++- packages/vue/playground/vite.config.ts | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/nuxt/playground/nuxt.config.ts b/packages/nuxt/playground/nuxt.config.ts index 949d33c..59c454d 100644 --- a/packages/nuxt/playground/nuxt.config.ts +++ b/packages/nuxt/playground/nuxt.config.ts @@ -1,7 +1,8 @@ import { resolve } from 'node:path' +import { fileURLToPath } from 'node:url' import { defineNuxtConfig } from 'nuxt/config' -const currentDir = new URL('.', import.meta.url).pathname +const currentDir = fileURLToPath(new URL('.', import.meta.url)) export default defineNuxtConfig({ modules: ['@unocss/nuxt', '../src/module'], diff --git a/packages/react/playground/vite.config.ts b/packages/react/playground/vite.config.ts index 0e57f69..1071da9 100644 --- a/packages/react/playground/vite.config.ts +++ b/packages/react/playground/vite.config.ts @@ -1,8 +1,9 @@ import { resolve } from 'node:path' +import { fileURLToPath } from 'node:url' import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' -const currentDir = new URL('.', import.meta.url).pathname +const currentDir = fileURLToPath(new URL('.', import.meta.url)) export default defineConfig({ plugins: [react()], diff --git a/packages/solid/playground/vite.config.ts b/packages/solid/playground/vite.config.ts index 2015f2f..cbaac7c 100644 --- a/packages/solid/playground/vite.config.ts +++ b/packages/solid/playground/vite.config.ts @@ -1,8 +1,9 @@ import { resolve } from 'node:path' +import { fileURLToPath } from 'node:url' import { defineConfig } from 'vite' import solid from 'vite-plugin-solid' -const currentDir = new URL('.', import.meta.url).pathname +const currentDir = fileURLToPath(new URL('.', import.meta.url)) export default defineConfig({ plugins: [solid()], diff --git a/packages/svelte/vite.config.ts b/packages/svelte/vite.config.ts index 4d61ae3..e237136 100644 --- a/packages/svelte/vite.config.ts +++ b/packages/svelte/vite.config.ts @@ -1,8 +1,9 @@ import { resolve } from 'node:path' +import { fileURLToPath } from 'node:url' import { sveltekit } from '@sveltejs/kit/vite' import { defineConfig } from 'vite' -const currentDir = new URL('.', import.meta.url).pathname +const currentDir = fileURLToPath(new URL('.', import.meta.url)) export default defineConfig({ plugins: [sveltekit()], diff --git a/packages/vue/playground/vite.config.ts b/packages/vue/playground/vite.config.ts index 16d166d..6d1cfec 100644 --- a/packages/vue/playground/vite.config.ts +++ b/packages/vue/playground/vite.config.ts @@ -1,8 +1,9 @@ import { resolve } from 'node:path' +import { fileURLToPath } from 'node:url' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' -const currentDir = new URL('.', import.meta.url).pathname +const currentDir = fileURLToPath(new URL('.', import.meta.url)) export default defineConfig({ plugins: [vue()],