A Webpack Plugin having zero dependencies which allows you to watch external files which are not included in the webpack build. It triggers a webpack build if any external file changes.
npm install webpack-watch-external-files-plugin --save-dev
# or
yarn add webpack-watch-external-files-plugin --dev
// webpack.config.js:
const WatchExternalFilesPlugin = require('webpack-watch-external-files-plugin');
module.exports = {
plugins: [
new WatchExternalFilesPlugin({
files: ['/path/**/*.js', '/path/tofile.txt', '!./src/**/*.json'],
}),
],
};
new WatchExternalFilesPlugin({
files: [],
});
- files[
list<string>
] - a list of files or glob patterns