1、安装useref插件
yarn add gulp-useref --dev
2、使用
const useref = () => { return src('dist/*.html',{base:'dist'}) .pipe(plugins.useref({searchPath:['dist','.']})) .pipe(dest('dist')) }