diff --git a/packages/nuxt/src/core/builder.ts b/packages/nuxt/src/core/builder.ts index 34a1735410..c26a07ff71 100644 --- a/packages/nuxt/src/core/builder.ts +++ b/packages/nuxt/src/core/builder.ts @@ -1,3 +1,4 @@ +import { pathToFileURL } from 'node:url' import chokidar from 'chokidar' import { isIgnored, tryResolveModule } from '@nuxt/kit' import { debounce } from 'perfect-debounce' @@ -82,6 +83,6 @@ async function bundle (nuxt: Nuxt) { async function loadBuilder (nuxt: Nuxt, builder: string) { const builderPath = await tryResolveModule(builder, [nuxt.options.rootDir, import.meta.url]) if (builderPath) { - return import(builderPath) + return import(pathToFileURL(builderPath).href) } }