-
-
Notifications
You must be signed in to change notification settings - Fork 261
Closed
Description
Hello! I have an issue with the tsup
, I have a TypeScript project with require.resolve
function, with pure tsc
it works, but when I try to build with tsup-node
I get this error:
TypeError: __require.resolve is not a function
I made a reproduction repo for this issue:
https://github.com/mvrlin/tsup-require-resolve
I came across this "solution":
// Before
var __require = (x) => {
if (typeof require !== "undefined")
return require(x);
throw new Error('Dynamic require of "' + x + '" is not supported');
};
// After
var __require = (x) => {
throw new Error('Dynamic require of "' + x + '" is not supported');
}
if (typeof require !== "undefined") {
__require = require
}
anymaniax
Metadata
Metadata
Assignees
Labels
No labels