taptapship / wiredep

Wire Bower dependencies to your source code.
MIT License
1.15k stars 142 forks source link

Add support for HTML imports #156

Closed silvenon closed 9 years ago

silvenon commented 9 years ago

http://www.html5rocks.com/en/tutorials/webcomponents/imports/

Web Components are pretty popular lately, so why not add support for HTML imports?

From what I've seen, most or all of Polymer's component don't have a main field specified, so I also added a fallback just like for JS files, which should work in most cases.

My idea is to make wiredep follow HTML imports and exclude assets that those HTML files already include, like it does with source HTML files, but I haven't implemented that yet.

What do you think about all of this?

I'll add tests after I know how (or whether) to proceed.

silvenon commented 9 years ago

On second thought, maybe it's a better idea to use overrides instead of the fallback detection. I just got this:

events.js:72
        throw er; // Unhandled 'error' event
              ^
RangeError: Maximum call stack size exceeded

when I wanted to wiredep core-scaffold because it has so many dependencies. Maybe the user won't want to include all those deps.

silvenon commented 9 years ago

After actually trying this I realized it's a bad idea, it's not useful because you don't import everything in one file, you import dependencies within dependencies.