-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Warn when code is uglified but not envified #1029
Labels
Comments
@gaearon what do you mean by checking whether a local identifier is crushed? |
Superseded by #1075. |
This was referenced May 24, 2024
This was referenced Jul 3, 2024
This was referenced Jul 27, 2024
Open
This was referenced Sep 24, 2024
Open
This was referenced Oct 25, 2024
This was referenced Oct 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From my series of tweets:
https://twitter.com/dan_abramov/status/665109454870982656
https://twitter.com/dan_abramov/status/665111615520563200
https://twitter.com/dan_abramov/status/665113061590761472
https://twitter.com/dan_abramov/status/665113349248704512
It's a common problem that people don't know they need to envify CommonJS builds. We need to help educate them about it, both in the docs and in the running code.
In the docs, we need to mention that you need tools like loose-envify (Browserify) or
DefinePlugin
(Webpack) to setprocess.env.NODE_ENV
to'production'
. Otherwise you're running a slower development-only build of React, Redux, and other libraries.In the source, we might want to try checking whether a local identifier is crushed. If it is, we're running in minified mode. If we're running in minified mode and
process.env.NODE_ENV
is something other than'production'
, we shouldconsole.error
, explain the mistake, and point to the relevant doc (a Medium article anyone?) about envifying.The text was updated successfully, but these errors were encountered: