Problem
Changes to .env or .env.<stage> do not take effect while sst dev is running.
Today the dev loop is:
- Edit
.env
- Stop
sst dev
- Start
sst dev again
- Wait for the app to redeploy
It would be useful if SST could watch env files and trigger a redeploy automatically, the same way it already does for source/config changes.
Example
export default $config({
app(input) {
return {
name: "my-app",
removal: input?.stage === "production" ? "retain" : "remove",
home: "aws",
watch: {
env: true,
},
};
},
});
Then changing either of these files should trigger a redeploy:
The next Pulumi/SST run should receive the updated env values.
Proposed API
Add an optional env flag to app.watch:
{
app: {
watch: {
env: true,
},
},
}
Default should probably be false to avoid changing existing behaviour.
Why this would help
This removes a common restart/redeploy cycle during local development.
For apps that use env vars in sst.config.ts or component config, tweaking local config/secrets would become part of the normal sst dev feedback loop instead of requiring a manual restart.
Problem
Changes to
.envor.env.<stage>do not take effect whilesst devis running.Today the dev loop is:
.envsst devsst devagainIt would be useful if SST could watch env files and trigger a redeploy automatically, the same way it already does for source/config changes.
Example
Then changing either of these files should trigger a redeploy:
The next Pulumi/SST run should receive the updated env values.
Proposed API
Add an optional
envflag toapp.watch:Default should probably be
falseto avoid changing existing behaviour.Why this would help
This removes a common restart/redeploy cycle during local development.
For apps that use env vars in
sst.config.tsor component config, tweaking local config/secrets would become part of the normalsst devfeedback loop instead of requiring a manual restart.