Skip to content

Commit c5bcfcb

Browse files
committed
Changed html2js plugin
From gulp-ng-html2js to gulp-angular-templatecache since the latter didn't prefix every module with a try cache. Approx 33% reduction in size in our case.
1 parent 3d514d2 commit c5bcfcb

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

gulpfile.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var gulp = require('gulp');
44

5-
var ngHtml2Js = require("gulp-ng-html2js");
5+
var templateCache = require('gulp-angular-templatecache');
66
var minifyHtml = require("gulp-minify-html");
77
var concat = require("gulp-concat");
88
var uglify = require("gulp-uglify");
@@ -18,9 +18,9 @@ gulp.task('bootstrap', function() {
1818
spare: true,
1919
quotes: true
2020
}))
21-
.pipe(ngHtml2Js({
22-
moduleName: "schemaForm",
23-
prefix: "directives/decorators/bootstrap/"
21+
.pipe(templateCache({
22+
module: "schemaForm",
23+
root: "directives/decorators/bootstrap/"
2424
}))
2525
);
2626
stream.queue(gulp.src('./src/directives/decorators/bootstrap/*.js'));
@@ -32,6 +32,7 @@ gulp.task('bootstrap', function() {
3232

3333
});
3434

35+
3536
gulp.task('minify',function(){
3637
gulp.src([
3738
'./src/module.js',

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
"karma-growler-reporter": "0.0.1",
2121
"karma-ng-html2js-preprocessor": "^0.1.0",
2222
"gulp": "^3.5.6",
23-
"gulp-ng-html2js": "^0.1.6",
2423
"gulp-uglify": "^0.2.1",
2524
"gulp-minify-html": "^0.1.1",
2625
"gulp-concat": "^2.2.0",
27-
"streamqueue": "0.0.5"
26+
"streamqueue": "0.0.5",
27+
"gulp-angular-templatecache": "^1.1.1"
2828
}
2929
}

0 commit comments

Comments
 (0)