Skip to content
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

Is there an enable flag that can be used inside Nextjs config? #203

Open
MauricioRobayo opened this issue Jan 26, 2024 · 0 comments
Open

Comments

@MauricioRobayo
Copy link

MauricioRobayo commented Jan 26, 2024

Something similar to @next/bundle-analyzer enabled flag.

For Nextjs, I imagine it would look something like this:

const envyConfig = {
  serviceName: 'next-app',
  enabled: process.env.ENVY === 'true'
};

Currently I'm doing something like this to avoid my logs to be filled with an infinite stream of envy errors if the webui is not running alongside:

module.exports = process.env.ENVY === 'true'
  ? withEnvy(nextConfig, envyConfig)
  : nextConfig;

and my script to run dev wtih envy looks like this:

"dev": "next dev",
"dev:envy": "npx concurrently \"npx @envyjs/webui\" \"ENVY=true npm run dev\"",

Or is there another recommended approach to this?

Awesome project btw!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant