【发布时间】:2016-11-11 01:05:28
【问题描述】:
北方人你好,我正在尝试使用 gulp 缩小我的 HTML,因为https://developers.google.com/speed/pagespeed/insights 告诉我我的网站太慢了。
我原来的html文件的结构是
/app/blog/page1.html
/app/contact/contactus.html
/app/xxx/xxx.html
使用我当前的代码,gulp 输出会将所有 html 文件放入 _build 文件夹中,但这对我不起作用,因为在页面加载时它会在相应文件夹中查找 html。我应该/我可以将缩小后的 html 放在其原始文件夹中,以便正常自动引用它吗?
gulp.task('minify-html', function () {
return gulp.src(configHTML.src)
.pipe(angularify())
.pipe(minifyHTML())
.pipe(gulp.dest('_build/'));
});
【问题讨论】:
标签: gulp