chore(demos): fix zonejs issue, add new template

This commit is contained in:
Drew Rygh
2015-09-30 16:21:52 -05:00
parent 43505407b3
commit c89deca542
5 changed files with 55 additions and 8 deletions

View File

@ -367,7 +367,8 @@ gulp.task('demos', function(){
.pipe(tsc, tscOptions, null, tscReporter)
.pipe(babel, getBabelOptions('demos'))
var indexTemplate = _.template(fs.readFileSync('scripts/demos/index.template.html'))();
var baseIndexTemplate = _.template(fs.readFileSync('scripts/demos/index.template.html'))();
var docsIndexTemplate = _.template(fs.readFileSync('scripts/demos/docs.index.template.html'))();
return gulp.src(['demos/**/*'])
.pipe(cache('demos', { optimizeMemory: true }))
@ -377,12 +378,18 @@ gulp.task('demos', function(){
function createIndexHTML() {
return through2.obj(function(file, enc, next) {
var indexTemplate = baseIndexTemplate;
if (file.path.indexOf('component-docs') > -1) {
indexTemplate = docsIndexTemplate;
}
this.push(new VinylFile({
base: file.base,
contents: new Buffer(indexTemplate),
path: path.join(path.dirname(file.path), 'index.html'),
}));
next(null, file);
});
}
})