Gulp AMPHTML Validator
A Gulp plugin for validating AMPHTML files using the official AMPHTML Validator.
Installation
Install package with NPM and add it to your development dependencies:
npm install --save-dev gulp-amphtml-validator
Usage
const gulpAmpValidator = require('gulp-amphtml-validator');
gulp.task('amphtml:validate', () => {
return (
gulp
.src('*.html')
.pipe(gulpAmpValidator.validate())
.pipe(gulpAmpValidator.format())
.pipe(gulpAmpValidator.failAfterError())
);
});
To treat warnings as errors, replace the last line of the validation closure with:
.pipe(gulpAmpValidator.failAfterWarningOrError());
Release Notes
1.0.6
- Use fancy-log log.info (#30744)
1.0.5
- Update repository location.
1.0.4
- Update amphtml-validator dependency to 1.0.30, gulp to 4.0.2 and mocha to
7.0.1.
1.0.3
- Remove engine section from pacakge.json to allow any version of gulpjs.
1.0.2
- Add failAfterWarningOrError option
- Upgrade amphtml-validator version to 1.0.21
1.0.1
- Upgrade amphtml-validator version to 1.0.18
1.0.0