html-validate-vue-webpack-plugin
TypeScript icon, indicating that this package has built-in type declarations

2.0.3 • Public • Published

html-validate-vue-webpack-plugin

extract html-validate rules from Vue single file components

Usage

Installation

Install the package and its peer dependencies:

npm install --save-dev html-validate-vue-webpack-plugin webpack

Configuration

Import the plugin and add it to your Webpack plugins:

const { HtmlValidateVueWebpackPlugin } = require("html-validate-vue-webpack-plugin");

module.exports = {
  plugins: [new HtmlValidateVueWebpackPlugin()],
};

For more advanced configuration check out the examples.

How it works

The package consist of three pieces, a webpack config, a webpack loader and a webpack plugin.

The webpack config consist of rules of how to handle .vue files.

The webpack loader handles the processing .vue files. For each file it will look for a <htmlvalidate>{}</htmlvalidate> block and assumes the JSON inside the tags is the html-validate rule for that component. The webpack loader will automatically look for the name for the html-validate rule. First it looks at the name property in the Vue file and will fallback to the filename. The name of the rule will be converted to kebab-case.

The webpack plugin combines the webpack config and webpack loader and applies the rules and processing to the your webpack config.

Examples

LICENSE

MIT

Package Sidebar

Install

npm i html-validate-vue-webpack-plugin

Weekly Downloads

24

Version

2.0.3

License

MIT

Unpacked Size

17.1 kB

Total Files

13

Last publish

Collaborators

  • anthonkendel