From b7b3af11d45d68383ef096a52e068224654befbd Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Sat, 15 Jun 2024 19:33:03 +0400 Subject: [PATCH] test(definitions): try to fix Unknown variable dynamic import on Windows https://github.com/asyncapi/spec-json-schemas/issues/539 --- vite.config.mts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/vite.config.mts b/vite.config.mts index 08292c11..e4b6ee01 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -1,5 +1,6 @@ import { viteRequire } from 'vite-require'; import { defineConfig } from 'vitest/config'; +import * as path from "node:path"; // https://vitejs.dev/config/ export default defineConfig({ @@ -17,17 +18,17 @@ export default defineConfig({ resolve: { alias: { // @ts-ignore - '@extensions': new URL('./extensions', import.meta.url).pathname, + '@extensions': path.resolve(__dirname, './extensions'), // @ts-ignore - '@examples': new URL('./examples', import.meta.url).pathname, + '@examples': path.resolve(__dirname, './examples'), // @ts-ignore - '@definitions': new URL('./definitions', import.meta.url).pathname, + '@definitions': path.resolve(__dirname, './definitions'), // @ts-ignore - '@bindings': new URL('./bindings', import.meta.url).pathname, + '@bindings': path.resolve(__dirname, './bindings'), // @ts-ignore - '@common': new URL('./common', import.meta.url).pathname, + '@common': path.resolve(__dirname, './common'), // @ts-ignore - '@test': new URL('./test', import.meta.url).pathname + '@test': path.resolve(__dirname, './test'), }, }, })