gulp-angular-templatecache缓存templateURL
文章参考
https://www.npmjs.com/package/gulp-angular-templatecache
利用缓存将 templateURL 的HTML缓存起来
npm 安装
npm install gulp-angular-templatecache --save-dev
例子
//引入gulp工具
var gulp = require("gulp");
//将angularjs 模板压缩并缓存
var templateCache = require('gulp-angular-templatecache');
/**
* 推荐
* 将html模板页面 以angularjs的方式 压缩并缓存
* */
gulp.task('angularTemplateCache', function () {
return gulp.src('templates/wap/**/*.html')
//templateHTML.js为压缩之后的文件名,注意.js后缀名不能少
.pipe(templateCache("templateHTML.js",{
//路径的前缀
root: 'templates/wap/',
//模块的名字
module:"huangbiaoApp"
}))
.pipe(gulp.dest('dist/'));
});压缩结果

相关推荐
星辰的笔记 2020-07-04
liangjielaoshi 2020-06-11
zhongweinan 2020-06-10
jiangfulai 2020-04-18
UndefineOrNull 2020-02-29
我有一只小松鼠 2020-02-29
UndefineOrNull 2020-03-01
hlihaihong 2020-02-18
UndefineOrNull 2020-02-12
yinuoqingqin 2020-01-13
星辰的笔记 2020-01-13
UndefineOrNull 2020-01-13
hlihaihong 2020-01-13
kaosini 2020-01-12
hlihaihong 2020-01-12
kaosini 2020-01-12
HSdiana 2019-12-25