Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: third_party/node/patch_vulcanize.diff

Issue 2733143002: WebUI: Locally patch vulcanize to not load excluded JS files. (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/node/node_modules.tar.gz.sha1 ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/node/patch_vulcanize.diff
diff --git a/third_party/node/patch_vulcanize.diff b/third_party/node/patch_vulcanize.diff
index 429abaaf3721463c866dbbccfe59a0ee07e52055..94ef2fd41503aeacff87ec36967b142caa12b53b 100644
--- a/third_party/node/patch_vulcanize.diff
+++ b/third_party/node/patch_vulcanize.diff
@@ -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) === '/') {
« no previous file with comments | « third_party/node/node_modules.tar.gz.sha1 ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698