jspm / jspm-cli

ES Module Package Manager
https://jspm.org
Apache License 2.0
3.79k stars 272 forks source link

Dev Watch Serve #2554

Open FluorescentHallucinogen opened 1 year ago

FluorescentHallucinogen commented 1 year ago

Currently while developing I use two tools:

  1. I use @web/dev-server with the --watch and --node-resolve option (web-dev-server --node-resolve --open --watch) that rewrites bare module imports on-the-fly e.g.
import moment from "moment";

will be rewritten on-the-fly to:

import moment from "/node_modules/moment/src/moment.js";

in all .html and .js files.

  1. I use JSPM CLI (jspm link index.html -p nodemodules -o index.html) that can use an HTML file as an entry point, generates only required import maps, then injecting the import map output back into the HTML file.

It's a different approach that I like better, because modern browsers now support import maps natively.

I'd be happy to completely abandon the first tool in favor of the second, but:

It would be great if the JSPM CLI could serve projects (serve files, watch changes and automatically on-the-fly update import maps in index.html).