Skip to content

Terminal colors with plugin-run-script #1038

Discussion options

You must be logged in to vote

Appears to be related to this.
chalk/chalk#381

So looks like a problem with chalk as a child process. Replacing chalk with colors or using normal ansi codes seems to work but gulp further uses chalk internally. Using --color flag to force colors fixes the issue. e.g:

"plugins": [
            [
                "@snowpack/plugin-run-script",
                {
                    "cmd": "",
                    "watch": "gulp watch --color"
                }
            ]
        ]

Another avenue might be to set environment variable FORCE_COLOR=1 somewhere. More clues here https://github.com/chalk/supports-color#info

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by brianjacobs-natgeo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant