1.0.0 • Published 3 years ago

watch-match-webpack-plugin v1.0.0

Weekly downloads
3
License
MIT
Repository
-
Last release
3 years ago

Watch Match Webpack Plugin

A Webpack plugin to invoke callback when file changed.

Install

npm install --save-dev watch-match-webpack-plugin

Usage

// webpack.config.js
const WatchMatchWebpackPlugin = require('watch-match-webpack-plugin')

module.exports = {
  plugins: [
    new WatchMatchWebpackPlugin({
      includes: '**/*',
      callback(matchedFiles) {
        console.log(
          'Hey look here, webpack watch these files have changed:\n',
          matchedFiles.join('\n')
        )
      },
    }),
  ],
}

Options

options.includes

Type: String | String[]

Default: **/*

Match rules use anymatch.

options.callback

Type: Function

Default: () => {}

Support sync or async function.

License

MIT

1.0.0

3 years ago

0.1.0

3 years ago