Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: normalize path for windows #317

Merged
merged 12 commits into from
Oct 14, 2024
7 changes: 6 additions & 1 deletion src/features.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { execSync } from 'node:child_process'
import { pathToFileURL } from 'node:url'
atinux marked this conversation as resolved.
Show resolved Hide resolved
import { isAbsolute } from 'pathe'
import type { Nuxt } from '@nuxt/schema'
import { logger, addImportsDir, addServerImportsDir, addServerScanDir, createResolver } from '@nuxt/kit'
import { joinURL } from 'ufo'
Expand Down Expand Up @@ -150,7 +152,10 @@ export async function setupBrowser(nuxt: Nuxt) {

export async function setupCache(nuxt: Nuxt) {
// Add Server caching (Nitro)
const driver = await resolvePath('./runtime/cache/driver')
let driver = await resolvePath('./runtime/cache/driver')
if (nuxt.options.dev && isAbsolute(driver)) {
driver = pathToFileURL(driver).href
}
nuxt.options.nitro = defu(nuxt.options.nitro, {
storage: {
cache: {
Expand Down