https://github.com/waldronmatt/html-validate-webpack-plugin
An HTML-validate.org plugin for webpack
https://github.com/waldronmatt/html-validate-webpack-plugin
html html-validate plugin validate webpack
Last synced: 11 months ago
JSON representation
An HTML-validate.org plugin for webpack
- Host: GitHub
- URL: https://github.com/waldronmatt/html-validate-webpack-plugin
- Owner: waldronmatt
- License: mit
- Created: 2021-02-03T02:15:22.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-02-03T02:19:10.000Z (about 4 years ago)
- Last Synced: 2025-03-28T16:43:42.882Z (12 months ago)
- Topics: html, html-validate, plugin, validate, webpack
- Language: JavaScript
- Homepage:
- Size: 17.6 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# html-validate-webpack-plugin
> An [html-validate.org](https://html-validate.org/) plugin for webpack
## About plugin
This plugin is a simple wrapper around the [html-validate.org](https://html-validate.org/) cli for automatic validation after each webpack compilation.
## Install
```bash
npm i -D html-validate-webpack-plugin
```
```bash
npm i -g html-validate
```
**Note**: You must have `html-validate` installed globally and create a `.htmlvalidate.json` at the project root with your [configurations](https://html-validate.org/usage/index.html).
## Usage
In your webpack configuration (development builds):
```js
const HtmlValidatePlugin = require('html-validate-webpack-plugin');
module.exports = {
plugins: [
new HtmlValidatePlugin(),
],
};
```
## Options
You can pass select [html-validate.org cli options](https://html-validate.org/usage/cli.html).
### `path`
- Type: `String`
- Default: `'src/**/*'`
Specifies the directories/files for html-validate to search.
### `extensions`
- Type: `array`
- Default: `['html']`
Specifies the file extensions to use when searching for files in directories.
### `config`
- Type: `String`
- Default: `'.htmlvalidate.json'`
Specify a different configuration file.
**Note:** For your custom configuration omit the `.json` extension and supply the name only.
## Features
- `html-validate` [performs all validation locally](https://html-validate.org/#offline) which means you can use `html-validate` and `html-validate-webpack-plugin` offline.
- `html-validate-webpack-plugin` contains minimal dependencies.
## License
MIT