Name resolution stop working when I set `path` and `basePath` options
See original GitHub issueI configured this plugin in serverless.yml
as below:
custom:
dotenv:
basePath: config
path: config/.env
I have some env files under config
directory:
config/.env
config/.env.joey
when I deploy with a stage name joey
, e.g. sls deploy --stage joey
, it still loads file config.env
. It doesn’t look at config.env.joey
. The output is always:
Serverless: DOTENV: Loading environment variables from config/.env:
If I remove the option basePath
and path
from serverless.yml
file and put these env files in the default location which is ./
. Everything works fine. Could you support automatic name resolution with customised path?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Resolve absolute path from relative path and/or file name
You can just add a base path: SET FilePath=%CD%\%1 so that it could be like C:\Foo\Bar\..\..\some\other\dir\file.txt . Programs seem to understand such a ......
Read more >Import Path Resolution — Solidity 0.8.17 documentation
When a source unit name is passed to the loader, it prepends the base path to it and performs a filesystem lookup. If...
Read more >How to define base url in swashbuckle 5.0 within asp.net core ...
I am using asp.net core 3.1 with swashbuckle 5. I am not able tofind the way for defining base url. RootUrl option seem...
Read more >Documentation - Module Resolution - TypeScript
A non-relative import can be resolved relative to baseUrl , or through path mapping, which we'll cover below. They can also resolve to...
Read more >File path formats on Windows systems | Microsoft Learn
In this article, learn about file path formats on Windows systems, such as traditional DOS paths, DOS device paths, and universal naming ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
One comment about the
basePath
option. I configured myserverless.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: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?
Nevermind,
basePath
is the way to go.