8 ms·
ESM is good, but if you've got more than a few dozen files in a project, you're going to start running into performance issues with complex waterfalls where the
by MrJohz 1y ago
ESM is good, but if you've got more than a few dozen files in a project, you're going to start running into performance issues with complex waterfalls where the browser can't start running a file until it's downloaded all the files it depends on, at which point it finds more files to download, and do on. Lots of projects don't need that amount of complexity, but the ones that do still need a bundler. And even if you don't have a project that big, a bundler can provide a lot of convenience by being able to, say, import different assets and have the bundler automatically provide the relevant URLs for use in the application. You're always trading off convenience for complexity here, but I find Vite and similar tools hit the sweet spot where they make my life easier without bringing in much complexity or overhead. Your experience might vary of course.
Similarly with TypeScript, having worked with and without it, I get so much from it that is a no-brainer for me. But maybe I'm just in the pocket of Big TypeScript and this is more of that gaslighting you were worried about... ;)