Skip to content

Commit

Permalink
fix(nitro): use file url for #build alias in windows dev (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Sep 5, 2021
1 parent 009579a commit d4a9f23
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rollup/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { pathToFileURL } from 'url'
import { dirname, join, normalize, relative, resolve } from 'upath'
import type { InputOptions, OutputOptions } from 'rollup'
import defu from 'defu'
Expand Down Expand Up @@ -209,7 +210,10 @@ export const getRollupConfig = (nitroContext: NitroContext) => {
'#nitro-renderer': normalize(require.resolve(resolve(nitroContext._internal.runtimeDir, 'app', renderer))),
'#config': normalize(require.resolve(resolve(nitroContext._internal.runtimeDir, 'app/config'))),
'#nitro-vue-renderer': vue2ServerRenderer,
'#build': nitroContext._nuxt.buildDir,
// Only file and data URLs are supported by the default ESM loader on Windows (#427)
'#build': nitroContext._nuxt.dev && process.platform === 'win32'
? pathToFileURL(nitroContext._nuxt.buildDir).href
: nitroContext._nuxt.buildDir,
'~': nitroContext._nuxt.srcDir,
'@/': nitroContext._nuxt.srcDir,
'~~': nitroContext._nuxt.rootDir,
Expand Down

0 comments on commit d4a9f23

Please sign in to comment.