You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Storybook pretty recently added support for dot env, but only for one file. This introduces the following issue: Even when adding manual dot env processing, the variables from Dotenv-Webpack are already defined (The plugin parses DotEnv files automatically when being initialized). There is the convention that DotEnv is never overriding anything - mainly because of supporting command line shell variables.
Steps to reproduce
Adding both a .env and .env.local the latter one is ignored completely.
Please specify which version of Storybook and optionally any affected addons that you're running
@storybook/react": "^4.0.0-alpha.4"
Affected platforms
All
Description
The following this does not work correctly:
.env:
API_SERVER = https://api.myservice.com/v1
.env.local:
API_SERVER = http://localhost:4000/
The issue is that the public API is already set before my app code - even when using a fully customized Webpack config is able to tweak it.
As CRA committed to use the multiple .env files, I feel that it's a good idea to do the same.
This should align dot env handling with CRA. It also automatically passes all APP_* settings to the application without requiring any safe .example files.
Acceptance criteria
Should parse .env.local before parsing .env.
Who to contact
Me :)
The text was updated successfully, but these errors were encountered:
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
Bug Report
Where CRA supports multiple dot env files for quite some time:
facebook/create-react-app#1343
Storybook pretty recently added support for dot env, but only for one file. This introduces the following issue: Even when adding manual dot env processing, the variables from Dotenv-Webpack are already defined (The plugin parses DotEnv files automatically when being initialized). There is the convention that DotEnv is never overriding anything - mainly because of supporting command line shell variables.
Steps to reproduce
Adding both a
.env
and.env.local
the latter one is ignored completely.Please specify which version of Storybook and optionally any affected addons that you're running
Affected platforms
Description
The following this does not work correctly:
.env
:.env.local
:The issue is that the public API is already set before my app code - even when using a fully customized Webpack config is able to tweak it.
As CRA committed to use the multiple
.env
files, I feel that it's a good idea to do the same.Easiest possible approach seems to be:
Replace this entry in the plugin list:
with
This should align dot env handling with CRA. It also automatically passes all
APP_*
settings to the application without requiring any safe.example
files.Acceptance criteria
Should parse
.env.local
before parsing.env
.Who to contact
Me :)
The text was updated successfully, but these errors were encountered: