5 ms·
Or you just can download/install with npm and create a bundle with esbuild.
by Scarbutt 3y ago
Or you just can download/install with npm and create a bundle with esbuild.
- simonw 3y agoI don't want to do any bundling - I want to use modules in my browser, at runtime.
- wruza 3y agoI understand there may be various reasons to avoid js bundling, but in case you avoid complexity, check out Vite. It’s zero config and can work on a regular directory (no node_modules, only index.html, styles, scripts). `vite` runs devserver with hmr, `vite build` generates dist. It may be useful to you even if you stick to esm downloading due to out of box support for all tech like ts, sass, less, etc. It’s basically an http server like npm/http-server, but with all modern tools automagically included.
- eyelidlessness 3y agoSo, the thing with Vite is that it’s great as long as your use case is in the happy paths it caters to. But if you diverge from them, its config story rapidly devolves to: - A very large subset of Rollup, which is so large that the docs seem to be self-mocking about it - Another very large subset of ESBuild, which is smaller but still non-trivial - A whole bunch of Vite-specific stuff that’s only partly (and incompletely/inconsistently) abstracting the omitted portions of those subsets - An enormous amount of terminology, some very poorly described in any docs if you even know which to consult - Plugins you’ll definitely need and which are a superset of Rollup’s, and the abstraction is so leaky that you’re often better off skipping the Vite keyword in your searches I mean, even in the worst case it’s not Webpack, but it’s astonishing how close it can feel very easily. And I don’t mean this nearly as harshly as it probably sounds. Vite really is great if it’s designed for your use case. But it’s far from the no-headaches panacea even I thought it was a few months ago.
- mhoad 3y agoAgree with this comment 100%. Worth noting that “the happy path” is not the same thing as the “standards compliant path” with Vite which is also a pain in the ass.