Because I am publishing libraries. Generally you don't want to bundle a library, you want to transpile it. You leave the bundling phase to an application.
Transpiling instead of bundling avoids some pitfalls. Just to cite one that comes to mind: If your library has a file`a.ts` importing a file `b.ts` including the statement `export * as X from "c.js"`, you could end up with a bundled file that includes an object `X` with the exported elements of `c.js`. This prevents tree-shaking when you bundle applications that use this library.
Transpiling (or just publishing js source files if you don't use TypeScript), also allows a better debugging experience (without relying on source map).
Another point: it is currently not possible to bundle TypeScript declaration files with a regular bundle. If you bundle your sources, you end with a distribution folder with a bundled file and a myriad of lonely declaration files. This is ugly and I am not sure if TypeScript is happy with that?
However, bundling offer also some advantages compared to transpiling: the publication size is smaller, you have less compatibility issues with Deno. Maybe I will switch to bundling my libraries if it doesn't reduce optimization when bundling an application, and when bundling declarations files will be available among the bundlers.
> If you publish your .ts files, people can import those directly. In my experience that works much better in Visual Studio Code than importing the .js files.
Do you know some projects which publish their ts sources?