Polymer / tools

Polymer Tools Monorepo
BSD 3-Clause "New" or "Revised" License
430 stars 200 forks source link

Add option for inlineHtml #1814

Open bedeoverend opened 9 years ago

bedeoverend commented 9 years ago

Would it be possible to add an inlineHtml option to vulcanize? Given the options to do the same with CSS and JS, it seems like a clean addition, particularly in resolving people's issues related to deduping and HTML imports.

My particular issue is that the majority of the time I'm using <link rel="import" ... is on reusable components, specifically relying on HTML imports deduping to reuse it without multiple requests. I'd love to know if this is a common use case and if it warrants adding the ability to disable inlining HTML imports.

ebidel commented 9 years ago

I might be confused, but inlining HTML is exactly what vulcanize does! It inlines the content from HTML imports.

The --strip-exclude flag will prevent the import from being inlined (e.g it preservers the link rel="import" and relies on deduping.

Is this what you mean?

garlicnation commented 9 years ago

@ebidel --strip-exclude Does not perserve the <link rel="import. It is intended for advanced use cases around sharding. @bedeoverend The flag you want is --exclude

ebidel commented 9 years ago

Right. Thanks for correcting.

bedeoverend commented 9 years ago

@ebidel Yeah I wasn't sure if it was appropriate for vulcanize to include, I may be wrangling vulcanize into doing something it was never intended to do. My view of it was inlining all resources, CSS, JS, and HTML. Given that there's the ability to prevent inlining of CSS and JS I was hoping HTML would be in there too, but I understand if this isn't the aim of vulcanize - perhaps I just need to find another inlining tool.

My specific purpose is to have a common build system for a collection of elements I'm developing - I was hoping to avoid relying on --exclude @garlicnation as that way I'd need to change the build process for each element to make sure all of its imports are kept and not inlined.

ebidel commented 9 years ago

Will leave it to @azakus to make the final call and/or close the issue.

garlicnation commented 9 years ago

@bedeoverend What is the purpose of your build system? You want to just inline the CSS and JS of a single file? I think it's possible with our existing tools, but I need to understand what you're trying to accomplish/the benefits of inlining some, but not all, of your dependencies.

bedeoverend commented 9 years ago

@garlicnation apologies for not replying sooner. So my purpose is to create multiple components referring to each other as bower dependencies. I can't get --exclude to do this for me because (as far as I can tell) it matches resolved file paths, but as I'm using the relative path structure the paths to sibling bower components don't resolved, so vulcanize crashes and --exclude has no effect. Would this be something vulcanize can do? Or potentially an option to ignore unresolved paths?

garlicnation commented 8 years ago

I believe vulcanize should still work for your use case.

Can you provide a reduced example of what you struggled with? I don't see any reason why I couldn't get the behavior you described.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.