From 2f6f50e2e0e17763c5d634d2de57a39350a74fb5 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 14 Jun 2022 13:50:02 +0100 Subject: [PATCH 1/2] fix(nuxt): normalize string transpile paths for windows --- packages/nuxt/src/core/nuxt.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/core/nuxt.ts b/packages/nuxt/src/core/nuxt.ts index 1a0640b58cb..4e22f0ec88d 100644 --- a/packages/nuxt/src/core/nuxt.ts +++ b/packages/nuxt/src/core/nuxt.ts @@ -1,4 +1,4 @@ -import { resolve } from 'pathe' +import { normalize, resolve } from 'pathe' import { createHooks } from 'hookable' import type { Nuxt, NuxtOptions, NuxtConfig, ModuleContainer, NuxtHooks } from '@nuxt/schema' import { loadNuxtConfig, LoadNuxtOptions, nuxtCtx, installModule, addComponent, addVitePlugin, addWebpackPlugin, tryResolveModule } from '@nuxt/kit' @@ -125,6 +125,9 @@ async function initNuxt (nuxt: Nuxt) { await nuxt.callHook('modules:done', { nuxt } as ModuleContainer) + // Normalize any Windows paths (\ => /) + nuxt.options.build.transpile = nuxt.options.build.transpile.map(t => typeof t === 'string' ? normalize(t) : t) + addModuleTranspiles() // Init nitro From ed7abca6d931072e6ee99f98635def3c50cfe939 Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Wed, 15 Jun 2022 13:52:33 +0200 Subject: [PATCH 2/2] Update packages/nuxt/src/core/nuxt.ts --- packages/nuxt/src/core/nuxt.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt/src/core/nuxt.ts b/packages/nuxt/src/core/nuxt.ts index 4e22f0ec88d..a8b4dffb298 100644 --- a/packages/nuxt/src/core/nuxt.ts +++ b/packages/nuxt/src/core/nuxt.ts @@ -125,7 +125,7 @@ async function initNuxt (nuxt: Nuxt) { await nuxt.callHook('modules:done', { nuxt } as ModuleContainer) - // Normalize any Windows paths (\ => /) + // Normalize windows transpile paths added by modules nuxt.options.build.transpile = nuxt.options.build.transpile.map(t => typeof t === 'string' ? normalize(t) : t) addModuleTranspiles()