New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read keys from ENV will increase bundle size #14453
Comments
Avoid using |
@alexander-akait Thanks, why does this code work? const { REACT_APP_NAME } = process.env;
const { REACT_APP_SURNAME } = process.env; |
@vankop I think we have this issue, I can't find... |
Yes, we had one. I have added this issue to |
@alexander-akait @vankop Thanks a lot, so have you any plan to handle destructure? |
It is not easy, but maybe yes |
And also I think this issue is for |
No, this is webpack issue. |
closing in favor of #14800 |
Hi Alex, Thank you for your effort. But I have doubt regarding the documentation of the web-pack 5. Specially EnvironmentPlugin and DefinePlugin. There it's mentioned we can use process.env clearly.
|
@BradPrit09 in documentation we use directly You can use |
Bug report
If we destructure more than one key from
process.env
, all keys will append to bundle file.# .env file REACT_APP_NAME=BEHNAM REACT_APP_SURNAME=MOHAMMADI
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
Just destructure more than 1 key from
process.env
What is the expected behavior?
Other relevant information:
webpack version: 4.41.2
Node.js version: 14.16.1
Operating System: macOS
Additional tools: Create React App
The text was updated successfully, but these errors were encountered: