We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Access to process.env is a slow, system-bound call.
process.env
After react restructured their project to cache access to process.env, they had a 2.4x - 3.8x performance improvement for server-side rendering,
facebook/react#812
This should also be done for vue, vue-server-renderer, vuex ... anything that accesses process.env.
An easy strategy might be to replace references to process.env.NODE_ENV with a reference to a singleton that checks process.env.NODE_ENV.
process.env.NODE_ENV
// foo.js if (process.env.NODE_ENV !== 'production') { // do stuff }
becomes
// isDevEnv.js export default process.env.NODE_ENV !== 'production'; // foo.js import isDevEnv from './isDevEnv'; if (isDevEnv) { // do stuff }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What problem does this feature solve?
Access to
process.env
is a slow, system-bound call.After react restructured their project to cache access to
process.env
, they had a 2.4x - 3.8x performance improvement for server-side rendering,facebook/react#812
This should also be done for vue, vue-server-renderer, vuex ... anything that accesses
process.env
.What does the proposed API look like?
An easy strategy might be to replace references to
process.env.NODE_ENV
with a reference to a singleton that checks process.env.NODE_ENV.becomes
The text was updated successfully, but these errors were encountered: