Skip to content

Respect NO_COLOR=1 environment variable #57

Description

@AdrianoKF

Describe the feature you'd like to request

When running a build with NO_COLOR=1, Vite does not put ANSI control sequences in the console output.

However, vite-plugin-image-optimizer does not yet honor this environment variable and generates colored output unconditionally. For example, this can be problematic when capturing the output in a log file. In my specific case, I'm trying to generate a GitHub PR comment containing the output from NO_COLOR=1 vite build, but the ANSI codes don't render correctly there.

Describe the solution you'd like

vite-plugin-image-optimizer should follow Vite's behavior and not produce colored output when the NO_COLOR=1 environment variable is set.

Since there already is an ansiColors configuration option, I imagine this should be an easy win.

Additional context

No response

Validations

  • Read the docs.
  • Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions