3 ms·
Esbuild is great. That said, I find as its one major weakness the inability to alias/dedupe libraries at least in a pnpm monorepo. Even if it's the same version
by tekkk 5y ago
Esbuild is great. That said, I find as its one major weakness the inability to alias/dedupe libraries at least in a pnpm monorepo. Even if it's the same version and I assume the same link, it will bundle it twice and you can get some pretty obscure errors when you run your app.
I did try various setups but none worked. With Vite at least I was able to alias libraries to same import thus avoiding importing them twice/x times.
But I'd kinda prefer using esbuild as Vite can get funky too, especially I've noticed if you build a local library with multiple chunks (eg just using tsc) the HMR will get out of hand. As I just tried, it basically seemed to go on indefinitely. Maybe there's a config for that but it's not nice, I can tell you that.