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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « third_party/node/node_modules.tar.gz.sha1 ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 diff --git a/bin/vulcanize b/bin/vulcanize 1 diff --git a/bin/vulcanize b/bin/vulcanize
2 index 956b2bc..ad8b29d 100755 2 index 956b2bc..ad8b29d 100755
3 --- a/bin/vulcanize 3 --- a/bin/vulcanize
4 +++ b/bin/vulcanize 4 +++ b/bin/vulcanize
5 @@ -35,6 +35,7 @@ var help = [ 5 @@ -35,6 +35,7 @@ var help = [
6 ' --redirect <uri>|<path>: Takes an argument in the form of URI|PATH where u rl is a URI composed of a protocol, hostname, and path and PATH is a local files ystem path to replace the matched URI part with. Multiple redirects may be speci fied; the earliest ones have the highest priority.', 6 ' --redirect <uri>|<path>: Takes an argument in the form of URI|PATH where u rl is a URI composed of a protocol, hostname, and path and PATH is a local files ystem path to replace the matched URI part with. Multiple redirects may be speci fied; the earliest ones have the highest priority.',
7 ' --no-implicit-strip: DANGEROUS! Avoid stripping imports of the transitive dependencies of imports specified with `--exclude`. May result in duplicate java script inlining.', 7 ' --no-implicit-strip: DANGEROUS! Avoid stripping imports of the transitive dependencies of imports specified with `--exclude`. May result in duplicate java script inlining.',
8 ' --out-html <path>: If specified, output will be written to <path> instead of stdout.', 8 ' --out-html <path>: If specified, output will be written to <path> instead of stdout.',
9 + ' --out-request-list <path>: Writes a list of request URLs required to vulca nize <html file> to <path> on success.', 9 + ' --out-request-list <path>: Writes a list of request URLs required to vulca nize <html file> to <path> on success.',
10 'Examples:', 10 'Examples:',
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 --- a/lib/constants.js 53 --- a/lib/constants.js
54 +++ b/lib/constants.js 54 +++ b/lib/constants.js
55 @@ -13,6 +13,6 @@ module.exports = { 55 @@ -13,6 +13,6 @@ module.exports = {
56 ABS_URL: /(^\/)|(^#)|(^[\w-\d]*:)/, 56 ABS_URL: /(^\/)|(^#)|(^[\w-\d]*:)/,
57 URL: /url\([^)]*\)/g, 57 URL: /url\([^)]*\)/g,
58 URL_ATTR: ['href', 'src', 'action', 'style', 'assetpath'], 58 URL_ATTR: ['href', 'src', 'action', 'style', 'assetpath'],
59 - URL_TEMPLATE: '{{.*}}|\\[\\[.*\\]\\]', 59 - URL_TEMPLATE: '{{.*}}|\\[\\[.*\\]\\]',
60 + URL_TEMPLATE: '{{.*}}|\\[\\[.*\\]\\]|\\$i18n[^{]*{[^}]*}', 60 + URL_TEMPLATE: '{{.*}}|\\[\\[.*\\]\\]|\\$i18n[^{]*{[^}]*}',
61 OLD_POLYMER: 'This version of vulcanize is not compatible with Polymer < 0.8. Please use vulcanize 0.7.x.' 61 OLD_POLYMER: 'This version of vulcanize is not compatible with Polymer < 0.8. Please use vulcanize 0.7.x.'
62 }; 62 };
63 diff --git a/lib/vulcan.js b/lib/vulcan.js
64 index 5aff456..2540dc1 100644
65 --- a/lib/vulcan.js
66 +++ b/lib/vulcan.js
67 @@ -414,19 +414,21 @@ Vulcan.prototype = {
68 },
69
70 getImplicitExcludes: function getImplicitExcludes(excludes) {
71 - // Build a loader that doesn't have to stop at our excludes, since we need them.
72 + // Build a loader that doesn't have to stop at our HTML excludes, since we
73 + // need them. JS excludes should still be excluded.
74 var loader = buildLoader({
75 abspath: this.abspath,
76 fsResolver: this.fsResolver,
77 - redirects: this.redirects
78 + redirects: this.redirects,
79 + excludes: excludes.filter(function(e) { return e.match(/.js$/i); })
80 });
81 var analyzer = new hyd.Analyzer(true, loader);
82 var analyzedExcludes = [];
83 excludes.forEach(function(exclude) {
84 - if (exclude.match(/.js$/)) {
85 + if (exclude.match(/.js$/i)) {
86 return;
87 }
88 - if (exclude.match(/.css$/)) {
89 + if (exclude.match(/.css$/i)) {
90 return;
91 }
92 if (exclude.slice(-1) === '/') {
OLDNEW
« 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