Webpack watch additional files. This plugin can trigger a build when these files change.
The livereload will be triggered if you use it but does not work with HRM.
npm i --save-dev webpack-watch-files-plugin
files
- (Default[]
) Array of patternsverbose
- (Defaultfalse
) List files found
import WatchExternalFilesPlugin from 'webpack-watch-files-plugin'
const config = {
// ... webpack config ...
plugins: [
// ....
new WatchExternalFilesPlugin({
files: [
'./src/**/*.js',
'!./src/*.test.js'
]
})
]
}