I’m writing a JavaScript lib with TypeScript, using the excellent Vite for on-the-fly transpiling and packaging. This post is about the config I use and specifically covers removal of comments because I Googled for a solution but it wasn’t obvious so I’m writing about it here.