mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 18:13:54 +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')
|