Hacker News new | ask | show | jobs
by spankalee 997 days ago
You don't need a bundler with multiple .ts files any more than with multiple .js file - which is that you don't "need" one at all.

Libraries especially don't and should be published to npm unbundled. Bundling is purely an application concern.

1 comments

So consumers are forced to use a bundler/ts just because some random dependency decided they're too lazy to deal with a bundler?

> Bundling is purely an application concern

by this logic all compiled languages' repos should just be source, no precompiled binaries.

yes. Always include source and let the user/client decide. Include a bundled version is OK, but it should be only there for convenience.
so explain to me again why I have to change my entire toolchain for simply consuming a library? What if I consume a wasm library written in Rust, suddenly I have to add rust into my build script? What is the point of bytecode if people are going to repeat the same build over and over again anyway?
it's unfortunate that javascript (and typescript) is not bytecode.
It's the same in that js is the standard runtime, and typescript is something that compiles to it, that's NOT used in all codebases