An html-validate.org webpack plugin
This plugin is a simple wrapper around the html-validate.org cli.
Validate your html automatically after each webpack compilation; similarly to how you would use eslint and stylelint.
npm install html-validate-webpack-plugin --save-dev
Note: Install html-validate
if you haven't already.
npm install html-validate --save-dev
Note: Create a .htmlvalidate.json
file with your configurations. See this page for instructions.
In your webpack configuration (development builds):
const HtmlValidatePlugin = require('html-validate-webpack-plugin');
module.exports = {
// ...
plugins: [new HtmlValidatePlugin()],
// ...
};
You can pass html-validate.org cli options.
- Type:
String
- Default:
src/**/*
Specifies the directories/files for html-validate to search.
- Type:
array
- Default:
['html']
Specifies the file extensions to use when searching for files in directories.
- Type:
String
- Default:
.htmlvalidate.json
Specify a different configuration file.
Note: For your custom configuration omit the .json
extension and supply the name only.
- Type:
boolean
- Default:
false
Specify the run context of html-validate.
Note: If you installed html-validate globally, set the value to true
.
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
MIT