Closed LeoniePhiline closed 3 years ago
Could you check if this works too?
-const isCompatibleTerminal =
- tty && tty.isatty(1) && env.TERM && env.TERM !== "dumb"
export const isColorSupported =
+ !isDisabled && (isForced || isWindows || (tty.isatty(1) && env.TERM && env.TERM !== "dumb") || isCI)
Hi @jorgebucaran Thanks for your reply! Only now I got to trying what you propose.
Version 1.4.0 is used, so isColorSupported
does not exist there.
Colorette 2.0 is still very new and packages (autoprefixer, browserslist, listr2, postcss, rollup, stylelint) don't use it yet.
Would it be possible to merge the PR for v1.4.1 and look for a v2.0.x fix separately?
We can retroactively fix the 1.4.x
line by publishing a new 1.4.1
as well as the 2.0.x
line.
Could you confirm my suggestion fixes the problem?
Lazily evaluate
enabled
checks and do not fail ifprocess.env
is not set.Both issues occur in
vite
's dev HMR mode, where plain, uncompiled JS modules are imported into the browser.This makes using
sanitize-html
impossible withvite
, sincesanitize-html
importspostcss
into browserland in order to parse CSS into an AST for sanitization.postcss
usescolorette
, which fail in the browser without this PR.This PR fixes https://github.com/jorgebucaran/colorette/issues/67