Sell me on tsup, please. #895
Replies: 4 comments 1 reply
-
I guess one cool thing I've found is the __dirname shim in ESM. That's pretty handy to have around! |
Beta Was this translation helpful? Give feedback.
-
@hitsthings was looking for the same, but in my case, I was setting up something new and deciding which path I should go. The advantage of |
Beta Was this translation helpful? Give feedback.
-
The Short AnswerThe output is cleaner. The Long VersionSo I used - 1. What I Needed To BundleThe most simple task ever: - 2. The difference in output between
|
Beta Was this translation helpful? Give feedback.
-
I came from the react-native-builder bob stuff and switched to this one because it was just simpler to deal with (until I started creating Jest snapshots). My working config was pretty simple import { defineConfig } from 'tsup';
export default defineConfig({
entry: ['src', '!src/__tests__/**', '!src/**/*.test.*'],
sourcemap: 'inline',
loader: {
'.snap': 'js',
},
}); Though there could be better ways of doing it. My ideal was a lot simpler than others though since I just need to make it work in a monorepo https://github.com/trajano/expo-experiments in other words I don't actually have to publish any packages just need to make sure there's a folder with javascript transpiled (defaults to |
Beta Was this translation helpful? Give feedback.
-
I have a TypeScript build that uses esbuild directly at the moment. I was looking for a page that describes what tsup does on top of esbuild, but haven't found it.
Can someone sell me on tsup? Should I switch my build to use it? Why should I use tsup instead of esbuild directly?
Please don't take this as questioning the usefulness of tsup - I'm sure it's got pros and cons like everything else and is useful in many situations. I am earnestly curious what tsup has to offer and am ignorant about it. I'd like to know when I should use it.
Thanks for any help!
Beta Was this translation helpful? Give feedback.
All reactions