-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Resolve node_modules from html tags #2808
Comments
These links in browsers are resolved as relative urls. There is no way for Parcel to distinguish relative imports of local files (other than forcing the use of The only syntax Parcel resolves specially is this (
-> #432 |
Ah! Hmm, I wonder if introducing something like a uri scheme might satisfy? (or is just getting too fancy—it's still potentially ambiguous…) <link rel="stylesheet" href="npm:normalize.css"> |
This isn't working for me, if I have an entry point in a |
@ric2b Actually, that's "per spec": https://parceljs.org/module_resolution.html (also happens with an JS file in
In your case, the entry root is |
I have managed to resolve this issue by specifying EDIT:
This isn't true and I'm afraid that not addressing this misconception will cause further problems. |
For Parcel 2, we are considering supporting an <link rel="stylesheet" href="npm:normalize.css"> Without the See #3492 (comment) for more details. |
Please follow #3492 for updates |
🙋 feature request
I think it'd be pretty helpful to support resolution of scripts/css/etc from HTML sources, following node's resolution rules.
For example, with https://github.com/necolas/normalize.css as a node dependency
index.html
I'd expect:
to be equivalent to
(This also implies support for the
style
key in package.json to figure out which file to resolve in alink rel="stylesheet"
context)The text was updated successfully, but these errors were encountered: