Skip to content

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

@MauricioRobayo

Description

@MauricioRobayo

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions