Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev Watch Serve #2554

Open
FluorescentHallucinogen opened this issue Nov 27, 2023 · 0 comments
Open

Dev Watch Serve #2554

FluorescentHallucinogen opened this issue Nov 27, 2023 · 0 comments

Comments

@FluorescentHallucinogen

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 requires an additional tool for serving files e.g. npx http-server -c-1
  • It requires the jspm link index.html -p nodemodules -o index.html command has to be run manually every time to update the import map

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant