Hi! :slightly_smiling_face: I'm testing out a sim...
# sst
r
Hi! 🙂 I'm testing out a simple stack with an SPA (Static Site) and Rest API. It's freakin' awesome. Just one thing that is slowing me down... currently when I run
sst start
it builds the SPA each time and the whole process takes a while. I have a few questions: • Is there a way to
sst start <stack>
? Usually I am working on the frontend locally and don't want to bother building it (which takes forever) • Can the Static Site skip building if there are no changes to the source? • Should I have the frontend / backend in separate Apps, rather than separate stacks? Then I can just manually start the backend one. (But also means I need to do multiple deployments and start scripting it and... it feels like a workaround) • Is there a guide for how to structure a project and general guidelines of when to split stacks and apps? It seems quite different to serverless framework...
r
Leftfield suggestion (as I can't answer the real question!) have you looked at Vite for building your SPA? We build our frontends with Vue and Vite is so much faster than webpack
r
Using Angular. It's actually pretty quick on my test project.. But I have another project I wanted to use it with that takes about 10 minutes to build by the times it's gone through the whole process. Can't easily speed that up either unfortunately.
Another idea... is there a way I can leverage something like
lerna
and just bump the version of my frontend?, then my
sst
app can have a dependency on my frontend package rather than linking directly to source. I don't think that's how it's intended to work though right?
I still think
sst start <stack>
would be the best solution 🙂
this worked!
Copy code
if (!process.env.IS_LOCAL) {
    new FrontendStack(app, "frontend-stack");
  }
I love CDK/SST
f
Hey @Ryan, I just created an issue for
sst start
single stack https://github.com/serverless-stack/serverless-stack/issues/448
Also, it seems not useful to build the
StaticSite
on
sst start
. Let me think about it.