fix(nuxt): pass path to `jiti` and not file URL (#27252)

This commit is contained in:
Daniel Roe 2024-05-16 10:11:19 -05:00 committed by GitHub
parent 58423772a1
commit 5ce738dbd8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
import { existsSync } from 'node:fs' import { existsSync } from 'node:fs'
import { mkdir, writeFile } from 'node:fs/promises' import { mkdir, writeFile } from 'node:fs/promises'
import { pathToFileURL } from 'node:url' import { fileURLToPath, pathToFileURL } from 'node:url'
import { dirname, resolve } from 'pathe' import { dirname, resolve } from 'pathe'
import chokidar from 'chokidar' import chokidar from 'chokidar'
import { interopDefault } from 'mlly' import { interopDefault } from 'mlly'
@ -26,7 +26,7 @@ export default defineNuxtModule({
const resolver = createResolver(import.meta.url) const resolver = createResolver(import.meta.url)
// Initialize untyped/jiti loader // Initialize untyped/jiti loader
const _resolveSchema = jiti(dirname(import.meta.url), { const _resolveSchema = jiti(dirname(fileURLToPath(import.meta.url)), {
esmResolve: true, esmResolve: true,
interopDefault: true, interopDefault: true,
cache: false, cache: false,