Vite has revolutionised web development for frontend js/ts apps. As it is based on rollup and supports library mode, I wonder if there is still any advantage building js libraries directly with rollup or shall I use vite instead?
Vite hides rollup's config complexity and allows to use many vite plugins, including vitest (for testing).
Vite, like any other abstraction, adds another layer on top of other tools like rollup and esbuild.
The advantage of more abstraction is that the tool is more easy to use and you can quickly start without having to make many configuration decisions.
An advantage of using rollup over Vite is that you probably have less complexity and dependencies in your tooling. If you know what you are doing, going with rollup can still be a viable choice. This is especially true if you don't need the dev server and your build process is simple.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With