Comments (7)
One comment about the basePath
option. I configured my serverless.yml
file to load from a folder containing all my env files, but the plugin consistently couldn't find them or resolve the environment names. I resolved the problem when I added a trailing '/' character to the property, like this:
dotenv:
basePath: env/
Note: I am developing on Windows 10 with Visual Studio Code. Perhaps other people may have different results on different platforms? Otherwise, perhaps this line should use some kind of environment specific path combine function?
from serverless-dotenv-plugin.
Nevermind, basePath
is the way to go.
from serverless-dotenv-plugin.
Ok, I figured out how it works. When I specify path
, it will ignore basePath
configuration and name resolution. Is it true? If yes, I can't specify a different file name?
from serverless-dotenv-plugin.
Did you ever got this to work?
from serverless-dotenv-plugin.
Ok, I figured out how it works. When I specify
path
, it will ignorebasePath
configuration and name resolution. Is it true? If yes, I can't specify a different file name?
That is correct. If path
is provided, basePath
is ignored:
serverless-dotenv-plugin/index.js
Lines 46 to 71 in 2b66c15
From the README:
This will disable automatic env file resolution
Could you describe your use case more? Are you looking to load environment variables from both config/.env.joey
and config/.env
when you run sls deploy --stage joey
?
from serverless-dotenv-plugin.
Hi @neverendingqs ,
As described in the documentation, when setting the property path
it disables the automatic env file resolution. Why so? Can we still have the resolution even when using a different path? Or is this a limitation in the dotenv
library?
from serverless-dotenv-plugin.
Closed due to inactivity. Please reopen when you get a chance to respond.
from serverless-dotenv-plugin.
Related Issues (20)
- Plugin should throw on error.
- Release GitHub action workflow only works if there is no branch protection. HOT 1
- Warn when incompatible options are set
- Automatic env file resolution is in reverse order of precedence HOT 7
- Create npmignore file
- Release (next)
- Consider how new variables engine in serverless could improve or impact this plugin HOT 2
- Document differences between Serverless's .env resolution and this plugin HOT 1
- NODE_ENV and stage collides to each other HOT 3
- System environment variables (wrongly) take higher precedence than the .env file HOT 7
- Cannot have parameterized `stage` and `region` HOT 2
- Serverless Framework v3: integrating with the new design
- Can't read multi line env variable - v2.62.0 HOT 2
- Not loading env file from stage param HOT 3
- basePath not getting resolve HOT 3
- Allow ability to set default environment name. HOT 2
- Feature Request: Add `envFile` to configuration.
- Question : setting env var HOT 1
- Fix links in package.json
- Add a pull request template
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless-dotenv-plugin.