watch-match-webpack-plugin
v1.0.0
Published
A Webpack plugin to invoke callback when file changed.
Downloads
17
Readme
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