-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: stderr to support tty (colors in errors) (#21)
fix: stderr with color
- Loading branch information
1 parent
85f5219
commit bd3ec4a
Showing
4 changed files
with
23 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const ignoreWarnings = new Set([ | ||
'--experimental-loader is an experimental feature. This feature could change at any time', | ||
'Custom ESM Loaders is an experimental feature. This feature could change at any time', | ||
]); | ||
|
||
const { emit } = process; | ||
|
||
// @ts-expect-error emit type mismatch | ||
process.emit = function (event: 'warning', warning: Error) { | ||
if ( | ||
event === 'warning' | ||
&& ignoreWarnings.has(warning.message) | ||
) { | ||
return; | ||
} | ||
|
||
return Reflect.apply(emit, this, arguments); | ||
}; |