From 8c14386ea77f9e97b9bcc68a01612b53f079bf49 Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Thu, 12 Nov 2015 09:02:51 -0500 Subject: [PATCH] PolyGerrit: Rework script imports With Buck, we won't easily be able to follow the directive in index.html to combine multiple .js files into a single app.js. Instead, move those includes into the top-level component gr-app.html, so vulcanize will simply inline them. This leaves index.html as a simple unvulcanized shim that will just load the polyfills and the top-level app. After this change, we can vulcanize gr-app.html and just swap out one path in index.html, otherwise serving it as-is. Change-Id: I782c4bbd259c03c2d7e2d33342462510a91f32e3 --- polygerrit-ui/app/elements/gr-app.html | 5 +++++ polygerrit-ui/app/index.html | 8 -------- polygerrit-ui/gulpfile.js | 5 ++++- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/polygerrit-ui/app/elements/gr-app.html b/polygerrit-ui/app/elements/gr-app.html index bdac450e24..d4534c61fd 100644 --- a/polygerrit-ui/app/elements/gr-app.html +++ b/polygerrit-ui/app/elements/gr-app.html @@ -114,3 +114,8 @@ limitations under the License. })(); + + + + + diff --git a/polygerrit-ui/app/index.html b/polygerrit-ui/app/index.html index f343288d8c..78071ec0f9 100644 --- a/polygerrit-ui/app/index.html +++ b/polygerrit-ui/app/index.html @@ -44,11 +44,3 @@ window.Polymer.dom = 'shadow'; - - - - - - - - diff --git a/polygerrit-ui/gulpfile.js b/polygerrit-ui/gulpfile.js index b4ea38c0f3..00581dc555 100644 --- a/polygerrit-ui/gulpfile.js +++ b/polygerrit-ui/gulpfile.js @@ -114,11 +114,14 @@ gulp.task('copy', function () { 'app/elements/**/*.js']) .pipe(gulp.dest('dist/elements')); + var scripts = gulp.src(['app/scripts/**/*.js']) + .pipe(gulp.dest('dist/scripts')); + var vulcanized = gulp.src(['app/elements/gr-app.html']) .pipe($.rename('gr-app.vulcanized.html')) .pipe(gulp.dest('dist/elements')); - return merge(app, bower, elements, vulcanized) + return merge(app, bower, elements, scripts, vulcanized) .pipe($.size({title: 'copy'})); });