fix: allow resolving relative package.json in vite mode

closes #146
This commit is contained in:
Daniel Roe 2021-02-05 22:09:16 +00:00
parent a8707469f8
commit abb21f30ca

View File

@ -34,7 +34,7 @@ export async function bundle (nuxt: Nuxt) {
} }
await mkdirp(nuxt.options.buildDir) await mkdirp(nuxt.options.buildDir)
const { dependencies = {}, devDependencies = {} } = createRequire(nuxt.options.rootDir)('package.json') const { dependencies = {}, devDependencies = {} } = createRequire(nuxt.options.rootDir)('./package.json')
await writeFile(resolve(nuxt.options.buildDir, 'package.json'), JSON.stringify({ await writeFile(resolve(nuxt.options.buildDir, 'package.json'), JSON.stringify({
private: true, private: true,
description: 'auto generated', description: 'auto generated',