BUG - When bundled in ES module, cannot run on platforms other than win32
vincesp opened this issue · 1 comments
vincesp commented
When bundled into an ES Module using rollup, the resulting code does not run on any platform other than win32. The following line yields an error:
Line 8 in 4e94689
Error:
(require != null && require$$0$h.isatty(1) && env.TERM !== "dumb") ||
^
ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and '.../package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
This expression is not evaluated on win32 as the previous line yields true
then.
Node.js v20.17.0
picocolors v1.1.0
picocolors v1.0.0 is not affected by this bug.