4 ms·
For local dev, I usually just spin up a server using python -m http.server . There are no conditional top level imports, but you can call import("thing") which
by dminik 3y ago
For local dev, I usually just spin up a server using python -m http.server .
There are no conditional top level imports, but you can call import("thing") which gives you a promise for the module.
- charred_patina 3y agoYou can also use the http-server npm package, but there's an issue with non-ES6 module resolution. I have started using Vite since it's lightweight, but also provides me with nice to haves module resolution for different module types, and hot reloading. I am not affiliated with Vite in any way, I just really like it for vanilla web dev.
- wruza 3y agoI also used http-server but pressing f5 or including live.js gets old quickly. Vite is a breath of fresh air, for both vanilla formats and “apps” with scss, ts, etc. Finally someone made a no-bs dev watcher and packager. The only thing to note for purists, it creates .vite folder which you have to ignore.