gulp-live-html-validator (Live HTML Validator)
This module is for the browser plugin «Live HTML Validator» — this is the browser plugin for real-time HTML validation of the browser page during web development.
You may also want to use:
Main documentation are live-html-validator
Installs
Step - 1
You need to install the browser plugin Live HTML Validator if you have not already installed it for:
Step - 2
npm i gulp-live-html-validator --save-dev
How to use
Example of how to establish a connection to the plugin «Live HTML Validator»
const
gulp = require('gulp'),
htmlValidator = require("gulp-live-html-validator"),
plumber = require('gulp-plumber'),
htmlmin = require('gulp-htmlmin');
const
htmlValidatorMain = new htmlValidator({
host: '127.0.0.1',
port: '8080'
});
function html() {
return gulp.src('src/**/*.html')
.pipe(plumber())
.pipe(htmlmin())
.pipe(htmlValidatorMain.check())
.pipe(gulp.dest('./dest/'))
}
function watch(){
htmlValidatorMain.run();
gulp.watch('src/**/*.html', gulp.series(html));
}
exports.html = html;
exports.watch = watch;