【发布时间】:2016-05-18 13:28:06
【问题描述】:
我试图避免缓存我的 Html 文件。 我尝试过使用 rev 和 rev-replace。 结果是只更改了文件名,但 stateprovider 中的文件引用没有更改,因此导致 files not found 错误。
这是我的 config.js 的一部分,它有 stateProvider:
$stateProvider .state('landingPage', { 网址:“/家”, templateUrl: "views/landingPage/landingPage.html", })
这是我的 gulp 文件的一部分:
gulp.task('copyHtml', ['copyAll','useRef'], function () {
return gulp.src('app/views/**/*.html')
.pipe(htmlmin({ collapseWhitespace: true, removeComments: true }))
.pipe(rev())
.pipe(revReplace())
.pipe(gulp.dest('dist/views'));
});
如何更改 config.js 中的文件引用?
内容不仅在移动设备上刷新(Android 上的 Chrome)。 我尝试在 stateProvider 中手动更改 html 文件的名称,但它也不起作用。
如何避免浏览器缓存???
谢谢
【问题讨论】:
标签: html angularjs gulp browser-cache gulp-rev