-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix color detection in edge runtime #56
Conversation
I ain't familiar with Vercel's Edge runtime; I don't know whether your version works as well. FYI this is the fork I'm using: brillout/picocolors@efd8707...main — you may like some of it. |
thanks for the fix, I'd like to know do we have any plan to publish it on npm? |
let tty = require("tty") | ||
|
||
let argv = process.argv || [], | ||
env = process.env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, shall we also handle scenarios when process
is undefined? (like in the browser)
env = typeof process !== 'undefined' ? process.env : {};
or would you like me to make another PR?
Per @brillout's comment here: #54 (comment) Edge Runtime has following constraints:
require
isundefined
process.argv
isundefined
Here I'm trying to fix this without blowing out the size of the package
picocolor.js
size goes from2594B
to2600B
.Closes #54