-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Using with @next/bundle-analyzer removes all process.env variable when use with config function #14969
Comments
Something like this would work: const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
module.exports = (phase) => {
return withBundleAnalyzer({})
} |
Maybe the document of @next/bundle-analyzer should be clearer on how to use with config function. Should I open for PR? |
Sure that's fine! |
illuminist
added a commit
to illuminist/next.js
that referenced
this issue
Jul 8, 2020
PR #14976 |
kodiakhq bot
pushed a commit
that referenced
this issue
Jul 9, 2020
#14969 It didn't specify on how to include the config with function config. This PR clarify the way to use the config with function.
rokinsky
pushed a commit
to rokinsky/next.js
that referenced
this issue
Jul 11, 2020
vercel#14969 It didn't specify on how to include the config with function config. This PR clarify the way to use the config with function.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Describe the bug
I added @next/bundle-analyzer to analyze bundle size in next.config.js, then all environment variable in
env
config got ignored.To Reproduce
env
property in returned config object. Let's call itTESTME
process.env.TESTME
, it will be undefined.https://codesandbox.io/s/pedantic-gagarin-xiqgl?file=/next.config.js
Expected behavior
process.env.TESTME
should have its value.Removing
withBundleAnalyzer()
will makeprocess.env.TESTME
hold its own value correctly.Also, this effects only function that returns config object. Passing config object directly into
withBundleAnalyzer()
seems to work normally.System information
The text was updated successfully, but these errors were encountered: