Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

html-validate-vue-webpack-plugin

1.0.0 • 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

Install

npm i html-validate-vue-webpack-plugin

DownloadsWeekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

21.2 kB

Total Files

14

Last publish

Collaborators

  • avatar