From a9a262f258ec5acaeb1c2914b398d9a596f97cd1 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 2 Nov 2020 01:13:35 +0100 Subject: [PATCH] fix: ensure builds are relative to buildDir --- packages/nitro/src/nuxt-deploy.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nitro/src/nuxt-deploy.ts b/packages/nitro/src/nuxt-deploy.ts index 292c52c13f..f69ae9c320 100644 --- a/packages/nitro/src/nuxt-deploy.ts +++ b/packages/nitro/src/nuxt-deploy.ts @@ -33,6 +33,9 @@ async function main () { consola.success('Using existing nuxt build from', prettyPath(config.buildDir)) } + // Ensure relative operations are relative to build dir (fixes rollup dynamic imports) + process.chdir(config.buildDir) + // Compile html template const htmlTemplateFile = resolve(config.buildDir, 'views/app.template.html') // TODO: nuxt3: document.template.html const htmlTemplateFileJS = htmlTemplateFile.replace(/.html$/, '.js').replace('app.', 'document.') @@ -78,7 +81,6 @@ async function main () { consola.success('Generated', prettyPath((ctx.rollupConfig.output as any).file), chalk.gray(`(Size: ${size} Gzip: ${zSize})`) ) - await hooks.callHook('rollup:done', ctx) } }