Skip to content

Commit

Permalink
fix(firebase-app-hosting): use relative path in runCommand (#2895)
Browse files Browse the repository at this point in the history
Co-authored-by: Pooya Parsa <[email protected]>
  • Loading branch information
Yuangwang and pi0 authored Nov 19, 2024
1 parent 612da35 commit 6c3d16e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/presets/firebase/preset.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineNitroPreset, writeFile } from "nitropack/kit";
import { version as nitroVersion } from "nitropack/meta";
import { basename, join } from "pathe";
import { basename, join, relative } from "pathe";
import type { Plugin } from "rollup";
import { genSafeVariableName } from "knitwork";
import { stringifyYAML } from "confbox";
Expand Down Expand Up @@ -83,12 +83,13 @@ const firebaseAppHosting = defineNitroPreset(
serveStatic: true,
hooks: {
async compiled(nitro) {
const serverEntry = join(nitro.options.output.serverDir, "index.mjs");
await writeFile(
join(nitro.options.rootDir, ".apphosting/bundle.yaml"),
stringifyYAML({
version: "v1",
runConfig: {
runCommand: "node .output/server/index.mjs",
runCommand: `node ${relative(nitro.options.rootDir, serverEntry)}`,
...(nitro.options.firebase as AppHostingOptions)?.appHosting,
},
metadata: {
Expand Down

0 comments on commit 6c3d16e

Please sign in to comment.