Why #nobuild Is Great For Libraries

There has been a lot of talk lately in the web dev world about #nobuild, the idea of going back to the world before compiling or bundling your code. Svelte has removed TypeScript from the Svelte library, DHH has posted extensively about it with ONCE and HEY. As much as I love TypeScript, I have to agree with them.

To be clear, I’m not suggesting #nobuild for apps. TypeScript and bundlers will always be an important piece of that puzzle, IMO. But for simple libraries that you use inside your apps, it’s undeniable the DX benefits of shipping the same code that you wrote, so you can edit your node_modules live and immediately contribute back your changes to the library.

You won’t have to deal with issues related to CJS and ESM, since you’ll hand write how you export your code for consumption. Your type definitions will be clean, since you’ll write those by hand as well. If you had to do this at the scale of an application, it would not be great, but next time you build a simple library, give it a try, you just might find your surprised by how nice it is.