From 28b77eda86c34900be3193d89265827e268e5344 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Wed, 24 Jul 2024 18:48:52 -0400 Subject: [PATCH] dev: ensure static site starts by default --- examples/aws-monorepo/infra/astro.ts | 12 ------------ examples/aws-monorepo/sst-env.d.ts | 4 ---- platform/src/components/aws/static-site.ts | 11 ++++++++--- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/examples/aws-monorepo/infra/astro.ts b/examples/aws-monorepo/infra/astro.ts index ddc136b35..1b7671fa0 100644 --- a/examples/aws-monorepo/infra/astro.ts +++ b/examples/aws-monorepo/infra/astro.ts @@ -8,15 +8,3 @@ export const astro = new sst.aws.Astro("Astro", { VITE_API_URL: api.url, }, }); - -export const astro2 = new sst.aws.Astro("Astro2", { - path: "packages/astro", - link: [bucket], - environment: { - VITE_API_URL: api.url, - FOO: "1", - }, - dev: { - autostart: false, - }, -}); diff --git a/examples/aws-monorepo/sst-env.d.ts b/examples/aws-monorepo/sst-env.d.ts index 0a625461e..1fec6d256 100644 --- a/examples/aws-monorepo/sst-env.d.ts +++ b/examples/aws-monorepo/sst-env.d.ts @@ -12,10 +12,6 @@ declare module "sst" { type: "sst.aws.Astro" url: string } - Astro2: { - type: "sst.aws.Astro" - url: string - } Database: { name: string type: "sst.aws.Dynamo" diff --git a/platform/src/components/aws/static-site.ts b/platform/src/components/aws/static-site.ts index 42fb7a8a7..777c86bac 100644 --- a/platform/src/components/aws/static-site.ts +++ b/platform/src/components/aws/static-site.ts @@ -377,9 +377,14 @@ export class StaticSite extends Component implements Link.Linkable { }), ), _dev: { - directory: sitePath, - environment, - command: "npm run dev", + environment: environment, + command: output(args.dev?.command).apply( + (val) => val || "npm run dev", + ), + directory: output(args.dev?.directory).apply( + (dir) => dir || sitePath, + ), + autostart: output(args.dev?.autostart).apply((val) => val ?? true), }, }); return;