首页 > 解决方案 > gulp-html - 如何验证外部页面

问题描述

我尝试通过 gulp-html 验证外部测试服务器的 html。

https://www.npmjs.com/package/gulp-html https://github.com/validator/gulp-html

我不明白如何为非本地站点配置“src”值。

文档中的示例是:

const html = () => {
  return gulp.src('src/index.html')
    .pipe(validator())
    .pipe(gulp.dest('dist/'));
};

我想用“https://example.com”替换“src/index.html”。

当我尝试它时,我收到一个错误:

 Error: File not found with singular glob: /path/to/project/https://example.com

标签: gulp

解决方案


推荐阅读