ensuring our index gets created (#591)

This commit is contained in:
kevgliss 2016-12-13 11:13:44 -08:00 committed by GitHub
parent 5dc0fa91e8
commit 3dad818af2
1 changed files with 5 additions and 6 deletions

View File

@ -20,7 +20,6 @@ var gulp = require('gulp'),
csso = require('gulp-csso'), csso = require('gulp-csso'),
useref = require('gulp-useref'), useref = require('gulp-useref'),
filter = require('gulp-filter'), filter = require('gulp-filter'),
rev = require('gulp-rev'),
revReplace = require('gulp-rev-replace'), revReplace = require('gulp-rev-replace'),
imagemin = require('gulp-imagemin'), imagemin = require('gulp-imagemin'),
minifyHtml = require('gulp-minify-html'), minifyHtml = require('gulp-minify-html'),
@ -166,8 +165,7 @@ function injectHtml(isDev) {
addRootSlash: false addRootSlash: false
}) })
) )
) ).pipe(gulp.dest('.tmp/'));
.pipe(gulp.dest('.tmp/'));
} }
gulp.task('dev:inject', ['dev:styles', 'dev:scripts'], function () { gulp.task('dev:inject', ['dev:styles', 'dev:scripts'], function () {
@ -190,15 +188,16 @@ gulp.task('build:ngviews', function () {
}); });
gulp.task('build:html', ['dev:styles', 'dev:scripts', 'build:ngviews', 'build:inject'], function () { gulp.task('build:html', ['dev:styles', 'dev:scripts', 'build:ngviews', 'build:inject'], function () {
var jsFilter = filter('**/*.js'); var jsFilter = filter(['**/*.js'], {'restore': true});
var cssFilter = filter('**/*.css'); var cssFilter = filter(['**/*.css'], {'restore': true});
return gulp.src('.tmp/index.html') return gulp.src('.tmp/index.html')
.pipe(rev())
.pipe(jsFilter) .pipe(jsFilter)
.pipe(ngAnnotate()) .pipe(ngAnnotate())
.pipe(jsFilter.restore)
.pipe(cssFilter) .pipe(cssFilter)
.pipe(csso()) .pipe(csso())
.pipe(cssFilter.restore)
.pipe(useref()) .pipe(useref())
.pipe(revReplace()) .pipe(revReplace())
.pipe(gulp.dest('lemur/static/dist')) .pipe(gulp.dest('lemur/static/dist'))