Closed tpluscode closed 7 years ago
Hmm, I could do that, but I was rather thinking of calculating difference between source and output location and modifying every link!
and script!
path using that diff. What do you think about that solution? Or should I do as you suggested?
Oh right, I didn't think about that. Definitely a good idea to have links transformed so that they work in output dir, if it's different.
But still I wouldn't remove any links if they are invalid...
Not a problem at all :). Thought it was better to not emit invalid imports, but it might actually be unwanted. I will however add a flag, sort of --noEmitInvalidLink
, to restore that behavior on demand (but the default will be as you described).
My thinking is that you can run into trouble when a link would actually be valid but incorrectly classified. Also, absolute HTTP hrefs (cdn?)
And I'd call the flag --stripBrokenLinks
or --stripInvalidLinks
Non-relative paths (cdns, absolute) are pretty easy to check, relative are much worse due to changing physical position. I can definitely leave invalid links, but the question is what to do with them? Warnings are fine if they are definitely dead links, but should not appear if they just don't match physical structure in design time. Any suggestions about that ^^?
I don't know. Maybe it's safe to assume that links will usually match a physical location relative to source or destination folder?
Yea it might be the best thing to do, at least for now. Nevertheless, I will not strip invalid links as you suggested :).
Fixed in #74.
Related to #57, I see that v0.1.12-beta.1 shows warning when an import is invalid but it also doesn't put those imports in the JS output.
For example, when I have
import 'link!../../polymer/polymer.html';
in a processed file, it gives the warning but not<link>
in output.It is obvious that such imports are invalid at build time of element project. I think that twc should fall back to looking in
bower_component
to see if the path would actually resolve tobower_components/polymer/polymer.html
.Do you think it's also worth observing
.bowerrc
in case the components folder has a non-default name?