diff --git a/gulpfile.js b/gulpfile.js index df3f9f5..573f301 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,6 +9,8 @@ var imagemin = require('gulp-imagemin'); var stripDebug = require('gulp-strip-debug'); var uglify = require('gulp-uglify'); var eventStream = require('event-stream'); +var templateCache = require('gulp-angular-templatecache'); +var minifyHTML = require('gulp-minify-html'); gulp.task("minify-404-css", function () { var vendorFiles = gulp.src("./src/assets/css/lib/bootstrap.min.css"); @@ -88,12 +90,19 @@ gulp.task('font', function () { gulp.src(fontSrc).pipe(gulp.dest(fontDst)); }); +gulp.task('templateCache', function() { + return gulp.src('src/app/**/*.html') + .pipe(minifyHTML({ conditionals: true, spare: true })) + .pipe(templateCache({ root: '/app/', module: 'BlurAdmin' })) + .pipe(gulp.dest('src/release/js')); +}); + gulp.task("watch", function () { gulp.watch(["./src/app/**/*.css", "./src/assets/**/*.css", "./**/*.scss "], ["minify-css"]); gulp.watch(imgSrc, ["imagemin"]); gulp.watch(["./src/app/**/*.js", "./src/assets/**/*.js"], ["js"]); }); -gulp.task("init", ["minify-css", "imagemin", "js", "font"]); +gulp.task("init", ["minify-css", "imagemin", "js", "font", 'templateCache']); gulp.task('default', ['init']); \ No newline at end of file diff --git a/package.json b/package.json index f7dae05..1327aa2 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,13 @@ "devDependencies": { "event-stream": "^3.3.1", "gulp": "^3.9.0", + "gulp-angular-templatecache": "^1.7.0", "gulp-autoprefixer": "^2.3.1", "gulp-changed": "^1.3.0", "gulp-concat": "^2.6.0", "gulp-imagemin": "^2.3.0", "gulp-minify-css": "^1.2.1", + "gulp-minify-html": "^1.0.4", "gulp-sass": "^2.0.4", "gulp-strip-debug": "^1.0.2", "gulp-uglify": "^1.4.0" diff --git a/src/index.html b/src/index.html index aecd29c..4feac58 100644 --- a/src/index.html +++ b/src/index.html @@ -60,6 +60,7 @@ + \ No newline at end of file