Skip to content

Commit 9adfacd

Browse files
committed
fix: properly resolve runtimeDir from chunks
1 parent 4af4f32 commit 9adfacd

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/cli.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
import mri from 'mri'
44
import { resolve } from 'pathe'
55
import { createNitro } from './nitro'
6-
import { build, prepare } from './build'
6+
import { build, prepare, copyPublicAssets } from './build'
77
import { createDevServer } from './server/dev'
8-
import { copyPublicAssets } from '.'
98

109
async function main () {
1110
const args = mri(process.argv.slice(2))

src/dirs.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { fileURLToPath } from 'url'
22
import { dirname, resolve } from 'pathe'
33

4-
export const distDir = dirname(fileURLToPath(import.meta.url))
5-
export const pkgDir = resolve(distDir, '..')
4+
let distDir = dirname(fileURLToPath(import.meta.url))
5+
if (distDir.endsWith('chunks')) {
6+
distDir = dirname(distDir)
7+
}
8+
export const pkgDir = resolve(distDir, distDir.endsWith('/chunks') ? '../..' : '..')
69
export const runtimeDir = resolve(distDir, 'runtime')

0 commit comments

Comments
 (0)