Registry /
devops / webpack-watch-external-files-plugin
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–223 runs
build_error
glibcnode 18–223 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
WatchExternalFilesPlugin
✓ import { WatchExternalFilesPlugin } from 'webpack-watch-external-files-plugin'
✗ const WatchExternalFilesPlugin = require('webpack-watch-external-files-plugin')
ESM-only since v4.x; use v3.x for CJS.
default (WatchExternalFilesPlugin)
✓ import WatchExternalFilesPlugin from 'webpack-watch-external-files-plugin'
✗ import WatchExternalFilesPlugin from 'webpack-watch-external-files-plugin'
Default export also works, but named is preferred.
ts type
✓ import type { WatchExternalFilesPluginOptions } from 'webpack-watch-external-files-plugin'
TypeScript types are bundled since v2.x.
Example webpack config showing how to watch external JSON configs excluding secrets.
import { WatchExternalFilesPlugin } from 'webpack-watch-external-files-plugin';
export default {
plugins: [
new WatchExternalFilesPlugin({
files: ['/config/**/*.json', '!/config/secrets.json'],
}),
],
};
Errors
Common errors & fixes
Cannot find module 'webpack-watch-external-files-plugin'
Missing install or Node.js version too low for ESM.
fixnpm install webpack-watch-external-files-plugin --save-dev and use Node >=20
WatchExternalFilesPlugin is not a constructor
Using require() on ESM-only v4+.
fixChange require to import: import { WatchExternalFilesPlugin } from 'webpack-watch-external-files-plugin' Error: [webpack-cli] Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
Passing empty or invalid options (e.g., files missing).
fixEnsure files option is an array of glob patterns.
Audit
Dependencies
webpackrequiredpeer dependency for plugin hooks