PolyGerrit: Rework script imports

With Buck, we won't easily be able to follow the <!-- build:js -->
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
This commit is contained in:
Dave Borowitz 2015-11-12 09:02:51 -05:00
parent cfd221eede
commit 8c14386ea7
3 changed files with 9 additions and 9 deletions

View File

@ -114,3 +114,8 @@ limitations under the License.
})(); })();
</script> </script>
</dom-module> </dom-module>
<script src="../bower_components/page/page.js"></script>
<script src="../scripts/app.js"></script>
<script src="../scripts/changes.js"></script>
<script src="../scripts/util.js"></script>

View File

@ -44,11 +44,3 @@ window.Polymer.dom = 'shadow';
<template is="dom-bind" id="app"> <template is="dom-bind" id="app">
<gr-app params="{{params}}" route="{{route}}"></gr-app> <gr-app params="{{params}}" route="{{route}}"></gr-app>
</template> </template>
<!-- build:js /scripts/app.js -->
<script src="/bower_components/page/page.js"></script>
<script src="/scripts/app.js"></script>
<script src="/scripts/changes.js"></script>
<script src="/scripts/util.js"></script>
<!-- endbuild-->

View File

@ -114,11 +114,14 @@ gulp.task('copy', function () {
'app/elements/**/*.js']) 'app/elements/**/*.js'])
.pipe(gulp.dest('dist/elements')); .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']) var vulcanized = gulp.src(['app/elements/gr-app.html'])
.pipe($.rename('gr-app.vulcanized.html')) .pipe($.rename('gr-app.vulcanized.html'))
.pipe(gulp.dest('dist/elements')); .pipe(gulp.dest('dist/elements'));
return merge(app, bower, elements, vulcanized) return merge(app, bower, elements, scripts, vulcanized)
.pipe($.size({title: 'copy'})); .pipe($.size({title: 'copy'}));
}); });