mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-15 18:34:50 +00:00
46f858dd82
Co-authored-by: Xin Du (Clark) <clark.duxin@gmail.com> Co-authored-by: pooya parsa <pyapar@gmail.com>
12 lines
336 B
TypeScript
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')
|