Feature request: Support different stages/environments by default #328
Description
Is your feature request related to a problem? Please describe.
Deploying to different stages is not just a recommended practice, it is a required practice for most web applications, so it's pretty strange that this component doesn't support it out of the box. Not having a dedicated testing stage can easily create weird bugs on the live site which users visit regularly
I am aware that there is an example, but that needs you to add and maintain your own solution for handling stages, which is not ideal, since if there's a package update, you'll have to work around any breaking changes.
Describe the solution you'd like
A configurable option in the serverless.yml
which creates a dedicated .serverless
folder for the deployed stage.
MyNextApp:
component: serverless-next.js
inputs:
stage: 'prod'
Describe alternatives you've considered
Rolling out my own solution based upon the example provided here. But then I ran into the same issue as mentioned in this issue. Correction: using a modified version of the example above, and committing the .serverless
folder solved the issue I was experiencing and the process creates the dedicated Deploy.<environment>.<config>.json
files.