I was using serverless templates and all worked fine until suddenly all my deployments started ignoring .env
files.
I searched through the documentation and it says that if I want to use the environment variables from .env files I now have to add useDotenv: true
in my serverless.yml
file. So I did:
app: xxx
org: xxx
useDotenv: true
There was no effect.
My serverless.yml
file contained nothing else before but the app and org variables.
Where do I need to add the seDotenv: true
in order to make it read my .env
variables?
You should put it at the root of your serverless.yml file.
I have mine just after the service attribute :
service: lb-courses
useDotenv: true
plugins:
- serverless-offline
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With