Commit 92c1a4cf authored by dpapad's avatar dpapad Committed by Commit bot

WebUI: Locally patch vulcanize to not load excluded JS files.

https://github.com/Polymer/polymer-bundler/pull/442/

BUG=597347

Review-Url: https://codereview.chromium.org/2733143002
Cr-Commit-Position: refs/heads/master@{#457536}
parent c08cf632
72d6150ddcff29c0bc48dfb8b175320cb3830d64
975e6a54d8e32856889d8619efceaf676cccc8d9
......@@ -60,3 +60,33 @@ index 21e1380..b6a353a 100644
+ URL_TEMPLATE: '{{.*}}|\\[\\[.*\\]\\]|\\$i18n[^{]*{[^}]*}',
OLD_POLYMER: 'This version of vulcanize is not compatible with Polymer < 0.8. Please use vulcanize 0.7.x.'
};
diff --git a/lib/vulcan.js b/lib/vulcan.js
index 5aff456..2540dc1 100644
--- a/lib/vulcan.js
+++ b/lib/vulcan.js
@@ -414,19 +414,21 @@ Vulcan.prototype = {
},
getImplicitExcludes: function getImplicitExcludes(excludes) {
- // Build a loader that doesn't have to stop at our excludes, since we need them.
+ // Build a loader that doesn't have to stop at our HTML excludes, since we
+ // need them. JS excludes should still be excluded.
var loader = buildLoader({
abspath: this.abspath,
fsResolver: this.fsResolver,
- redirects: this.redirects
+ redirects: this.redirects,
+ excludes: excludes.filter(function(e) { return e.match(/.js$/i); })
});
var analyzer = new hyd.Analyzer(true, loader);
var analyzedExcludes = [];
excludes.forEach(function(exclude) {
- if (exclude.match(/.js$/)) {
+ if (exclude.match(/.js$/i)) {
return;
}
- if (exclude.match(/.css$/)) {
+ if (exclude.match(/.css$/i)) {
return;
}
if (exclude.slice(-1) === '/') {
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment