Nuxt/packages/bridge/src/dirs.ts
Anthony Fu 46f858dd82
chore: move nuxt-vite to bridge (#1180)
Co-authored-by: Xin Du (Clark) <clark.duxin@gmail.com>
Co-authored-by: pooya parsa <pyapar@gmail.com>
2021-10-26 14:59:05 +02:00

12 lines
336 B
TypeScript

import { fileURLToPath } from 'url'
import { existsSync } from 'fs'
import { join } from 'path'
import { dirname } from 'pathe'
let dir = dirname(fileURLToPath(import.meta.url))
while (dir !== '/' && !existsSync(join(dir, 'package.json'))) {
dir = dirname(dir)
}
export const pkgDir = dir
export const distDir = join(pkgDir, 'dist')