Serverless-next.js: gitignore .serverless/ and .serverless_nextjs/

Created on 28 Jan 2020  路  3Comments  路  Source: serverless-nextjs/serverless-next.js

Is it good practice to add .serverless/ and .serverless_nextjs/ to .gitignore?

My repo is getting cluttered with templates and and output function code that I'd rather keep out.

I've tried adding .serverless_nextjs/ to gitignore and this seems fine. The dir gets recreated on build and the deploy works.
However, ignoring .serverless/ files seem to cause my app to deploy to a brand new aws lambda function after removing the dir and rebuilding. There must be something in that directory that is holding a reference to the existing lambdas.

I wonder what the workflow would look like if I were to switch laptops and continue coding on another machine. I guess the .serverless dir must exist in order to deploy to the correct lambda.

Has anyone else dealt with this? I'm interested.

Most helpful comment

I think https://github.com/danielcondemarin/serverless-next.js/tree/master/packages/serverless-nextjs-component#cicd-a-new-cloudfront-distribution-is-created-on-every-ci-build-i-wasnt-expecting-that should answer your question

All 3 comments

I think https://github.com/danielcondemarin/serverless-next.js/tree/master/packages/serverless-nextjs-component#cicd-a-new-cloudfront-distribution-is-created-on-every-ci-build-i-wasnt-expecting-that should answer your question

@claygorman is right, the FAQ has the answer 馃檪

Cheers!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sidartha picture sidartha  路  6Comments

pedropinheiro75 picture pedropinheiro75  路  7Comments

mikdatdogru picture mikdatdogru  路  7Comments

danielcondemarin picture danielcondemarin  路  4Comments

SarKurd picture SarKurd  路  7Comments