Replies: 4 comments 7 replies
-
@mcmxcdev I was able to get @next/bundle-analyzer to work but I had to manually set the env value in my .env.local |
Beta Was this translation helpful? Give feedback.
-
Hello,
This are just some examples. Each I also tried with |
Beta Was this translation helpful? Give feedback.
-
You can use "bundle-analyzer": {
"executor": "nx:run-commands",
"options": {
"command": "ANALYZE=true nx build myapp --prod"
}
} And run it simply like |
Beta Was this translation helpful? Give feedback.
-
When using import withBundleAnalyzer from '@next/bundle-analyzer'
if (process.env.ANALYZE === 'true') {
plugins.push(withBundleAnalyzer({ enable: true }))
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to integrate https://www.npmjs.com/package/@next/bundle-analyzer into a next.js app as part of a nx workspace.
The dependency recommends toggling the analyzer based on
process.env.ANALYZE
env flag which is enabled in a npm script inpackage.json
.With our nx setup, we don't have any
package.json
files (onlyproject.json
) except for the root one and would like to keep it that way.Is there any way to have the
@nrwl/next:build
executor support setting an env likeprocess.env.ANALYZE
to make this work?We are also missing a way to reuse an existing executor target e.g.
build
and just reuse it like npm scripts asbuild:analyze
Beta Was this translation helpful? Give feedback.
All reactions