简体   繁体   English

聚合物硫化保持外部联系

[英]polymer vulcanize keep external links

I am using Polymer to build widget in my web app, since I need my web app works with Mozilla and IE I need vulcanize my widget/custom-tags in single file .html, then the polymer frameworks will be include in my file .html. 我正在使用Polymer在我的Web应用程序中构建窗口小部件,因为我需要将Web应用程序与Mozilla和IE一起使用,所以我需要在单个文件.html中硫化我的窗口小部件/自定义标签,然后将聚合物框架包含在我的文件.html中。 That's fine if I have one single page, but since I need to use Polymer in different web pages that force me to download the framework Polymer more than once. 如果我只有一个页面,那很好,但是由于我需要在不同的网页中使用Polymer,这迫使我多次下载Polymer框架。 There is a way to vulcanize the page and download Polymer just once? 有一种方法可以硫化页面并仅下载一次Polymer? I mean without include the framework into the page but still using external link 我的意思是没有在页面中包含框架,但仍使用外部链接

thanks 谢谢

michele 米歇尔

The option you are looking for is the --exclude flag: 您正在寻找的选项是--exclude标志:

vulcanize --exclude "path/to/target/subpath/" --exclude "path/to/target/subpath2/" target.html

It will do exactly what you are asking for. 它将完全满足您的要求。

https://github.com/polymer/vulcanize https://github.com/polymer/vulcanize

Maybe I explain in bad way myself, My achievement is "download the framework Polymer just once" and not in any single web page of my website. 也许我自己用不好的方式进行了解释,我的成就是“一次下载了Polymer框架”,而不是在网站的任何网页上。 the solution I have found is - open the file polymer.html - copy the javascript code - past in a new file ex. 我发现的解决方法是-打开文件polymer.html-复制javascript代码-过去保存在新文件中。 polymer.js - go to the web page which use polymer and change the tag in polymer.js-转到使用聚合物并在其中更改标签的网页

So that my web pages will download the framework Polymer just once 这样我的网页将只下载一次Polymer框架

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM