mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 11:17:19 +08:00
chore(demos): fix zonejs issue, add new template
This commit is contained in:
@ -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);
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user