js.pipe
scripts and styles will be created by concatenation and minification of original *.css -叮 dev.html 到
<!-- replaceStart: nameOfBlock-css -->
<link href="/css/one.css" />
<link href="/css/two.css" />
<link href="/css/three.css" />
<!-- replaceEnd-->
<!-- replaceStart: nameOfBlock-js -->
<link href="/js/one.js"/>
<link href="/js/two.js/>
<!-- replaceEnd-->
public.html 囫囵吞枣
<link href="/css/oneTwoThree.min.css" />
内容 minifiedCSSLinks.css
<link href="/js/oneTwo.min.js" />
和 minifiedJSLink.jsgulp-html-replace, 囫囵吞枣 或 gulp-string-replace但我不知道如何让它们简单地抓取文件的内容(除了读取文件的内容并以字符串的形式传递给替换函数--我想相信模块可以做到这一点)。理想情况下,我希望在
gulp.src('default.html')
.replace({nameOfBlock-css: 'minifiedCSSLinks.html'})
.replace({nameOfBlock-js: 'minifiedJSLinks.html'})
...
gulpfile.js:EDIT: The *.min.css