FormidableLabs / FormidableLabs/envy
Is there an enable flag that can be used inside Nextjs config?
- Dominant language
- TypeScript
- Stars
- 144
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
Something similar to @next/bundle-analyzer [enabled flag](https://www.npmjs.com/package/@next/bundle-analyzer#usage-with-environment-variables).
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!
Contributor guide
Assessment
This issue has not been assessed yet.