Can I use Vite/Rollup to just transpile to cjs/esm without bundling?

75 Views Asked by At

I'm looking to use Vite/Rollup to just transpile files from .ts/tsx to .cjs or .mjs files without bundling everything into one big file.

I know that it's the point of Rollup to roll everything up into one file. But Rollup is also handy in providing a bunch of presets to deal with e.g. Typescript files and Preact.

1

There are 1 best solutions below

0
Alexander Nenashev On

I guess you could try output.preserveModules:

https://rollupjs.org/configuration-options/#output-preservemodules