From 018302cb0baf8c54e0d0571336339b480eab3184 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 22 Oct 2021 12:57:21 +0100 Subject: [PATCH] fix(nitro): update firebase preset to handle mjs output (#1360) --- packages/nitro/src/presets/firebase.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/nitro/src/presets/firebase.ts b/packages/nitro/src/presets/firebase.ts index 9cabb49a94..188b8796b6 100644 --- a/packages/nitro/src/presets/firebase.ts +++ b/packages/nitro/src/presets/firebase.ts @@ -53,10 +53,10 @@ async function writeRoutes ({ output: { publicDir, serverDir }, _nuxt: { rootDir return obj }, {} as Record) - let nodeVersion = '12' + let nodeVersion = '14' try { const currentNodeVersion = fse.readJSONSync(join(rootDir, 'package.json')).engines.node - if (['12', '10'].includes(currentNodeVersion)) { + if (['16', '14'].includes(currentNodeVersion)) { nodeVersion = currentNodeVersion } } catch {} @@ -66,7 +66,8 @@ async function writeRoutes ({ output: { publicDir, serverDir }, _nuxt: { rootDir JSON.stringify( { private: true, - main: './index.js', + type: 'module', + main: './index.mjs', dependencies, devDependencies: { 'firebase-functions-test': 'latest',