lingui extract doesn't set NODE_ENV required by babel-preset-react-app
See original GitHub issueWhen I run ‘lingui extract’ I receve this message error:
Error: Using
babel-preset-react-apprequires that you specify
NODE_ENVor
BABEL_ENV environment variables. Valid values are "development", "test", and "production". Instead, received: undefined.
‘lingui extract’ work only with this setup: ‘NODE_ENV=production lingui extract’
Is it a bug? What’s the problem?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
babel-preset-react-app not picking up environment variables
Using babel-preset-react-app requires that you specify NODE_ENV or BABEL_ENV environment variables. Valid values are "development", "test", ...
Read more >How to setup your perfect Webpack dev server environment ...
The first step I need to make is to create an environment variable called NODE_ENV . This is required for the babel preset...
Read more >WebPack production environment is NOT the NODE_ENV or ...
BABEL_ENV, when this is not available then it uses process.env.NODE_ENV if even that is not available then it defaults to "development". Alright ...
Read more >react-app-rewired - npm Package Health Analysis - Snyk
Tweak the create-react-app webpack config(s) without using 'eject' and without creating a fork of the ... Get started free ... No known security...
Read more >How can I set NODE ENV production on Windows - Edureka
NODE_ENV =production node myapp/app.js. However, this doesn't work on Windows. Is there a configuration file where I can set the attribute?
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 FreeTop 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
Top GitHub Comments
Create React App uses
development
env for everything except for build. Ideally we should handle this without a warning, because CRA handles it under the hood without user’s interference.I’m trying to come up with scenario, when extracting messages in
development
env would be harmful (or inproduction
)… It seems that for our usecase (extracting messages from source), there’s no difference. Setting env toproduction
might be after all safer option.Ideas welcome!
I want to close this with upcoming 3.0 release, which will have better support for CRA.
Update: The env will be set to
development
after all.I’m working on new version of plugins/macros and in production mode they will remove all unnecessary attributes, like
description
anddefaults
. These attributes are used only offline (either in message catalogs as a hint for translators or during compile), but they aren’t needed in production.