1、安装useref插件
yarn add gulp-useref --dev
2、使用
const useref = () => { return src(‘dist/*.html‘,{base:‘dist‘}) .pipe(plugins.useref({searchPath:[‘dist‘,‘.‘]})) .pipe(dest(‘dist‘)) }
Gulp自动化构建案例---useref文件引用处理
原文:https://www.cnblogs.com/phantomyy/p/14501291.html