Skip to content

Commit

Permalink
fix(cli): Handle start (npm start) with ssr dev server
Browse files Browse the repository at this point in the history
Handle `preview` as alias of `serve`
  • Loading branch information
leomp12 committed Mar 12, 2024
1 parent 5a3db15 commit 0093426
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default async () => {
return $`firebase --project=${projectId} ${cmd} ${options}`;
};

if (argv._.includes('serve')) {
if (argv._.includes('serve') || argv._.includes('preview')) {
if (argv.build !== false) {
await build(argv.codebase);
}
Expand All @@ -119,7 +119,7 @@ ${chalk.bold('npx kill-port 4000 9099 5001 8080 5000 8085 9199 4400 4500')}
});
}

if (argv._.find((cmd) => /^(\w+:)?(shell|start)$/.test(cmd))) {
if (argv._.find((cmd) => /^(\w+:)?shell$/.test(cmd))) {
return $firebase('functions:shell');
}
if (argv._.find((cmd) => /^(\w+:)?logs?$/.test(cmd))) {
Expand Down Expand Up @@ -216,7 +216,7 @@ Finish by saving the following secrets to your GitHub repository:
return prepareCodebases();
}

if (argv._.includes('dev') || !argv._.length) {
if (argv._.includes('dev') || argv._.includes('start') || !argv._.length) {
await prepareCodebases(true);
const prefix = joinPath(pwd, 'functions/ssr');
// https://docs.astro.build/en/reference/cli-reference/#astro-dev
Expand Down

0 comments on commit 0093426

Please sign in to comment.