egoist / tsup

The simplest and fastest way to bundle your TypeScript libraries.
https://tsup.egoist.dev
MIT License
8.46k stars 209 forks source link

How to resolve `import` and `require` errors? #1117

Closed yuguaa closed 1 month ago

yuguaa commented 1 month ago

image image image

When I use tsup to bundle, and in a JavaScript file I use import or require to import npm packages like axios, I encounter errors when including the bundled JS file in a native HTML file. How can I resolve this issue? Please...

Upvote & Fund

Fund with Polar

yuguaa commented 1 month ago

platform?: "node" | "browser" | "neutral"