{"id":20856,"library":"webpack-watched-glob-entries-plugin","title":"Webpack Watched Glob Entries Plugin","description":"Webpack plugin (v3.2.0) that allows you to use glob patterns to define entry points and automatically watches those glob matches for changes during development. It integrates with webpack's watch mode so that adding or removing files matching the glob triggers a rebuild without manual configuration. Supports multiple glob patterns, custom glob options like ignore patterns, and preserves directory structure in output names. Requires Node >=18 and webpack 5. Unlike manual entry arrays, this plugin dynamically updates entries as files change, making it ideal for projects with many entry points or those that frequently add/remove source files. Released relatively infrequently, with maintenance focused on dependency updates and Node version support.","status":"active","version":"3.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/Milanzor/webpack-watched-glob-entries-plugin","tags":["javascript"],"install":[{"cmd":"npm install webpack-watched-glob-entries-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-watched-glob-entries-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-watched-glob-entries-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for the plugin to function","package":"webpack","optional":false},{"reason":"used internally for file globbing","package":"glob","optional":false}],"imports":[{"note":"Package does not export ESM; use CommonJS require. For TypeScript, use `import WebpackWatchedGlobEntries = require('...')` or `const WebpackWatchedGlobEntries = require('...')`.","wrong":"import WebpackWatchedGlobEntries from 'webpack-watched-glob-entries-plugin';","symbol":"WebpackWatchedGlobEntries","correct":"const WebpackWatchedGlobEntries = require('webpack-watched-glob-entries-plugin');"},{"note":"getEntries is a static method on the class, not an instance method.","wrong":"new WebpackWatchedGlobEntries().getEntries()","symbol":"getEntries","correct":"WebpackWatchedGlobEntries.getEntries(globs, options)"},{"note":"Must instantiate with `new` before adding to plugins array.","wrong":"plugins: [WebpackWatchedGlobEntries]","symbol":"WebpackWatchedGlobEntries (as plugin)","correct":"plugins: [new WebpackWatchedGlobEntries()]"}],"quickstart":{"code":"// webpack.config.js\nconst path = require('path');\nconst WebpackWatchedGlobEntries = require('webpack-watched-glob-entries-plugin');\n\nmodule.exports = {\n  entry: WebpackWatchedGlobEntries.getEntries(\n    [\n      path.resolve(__dirname, 'src/entries/**/*.js'),\n      path.resolve(__dirname, 'src/pages/**/*.js')\n    ],\n    { ignore: '**/*.test.js' }\n  ),\n  output: {\n    path: path.resolve(__dirname, 'dist'),\n    filename: '[name].js'\n  },\n  plugins: [\n    new WebpackWatchedGlobEntries()\n  ],\n  mode: 'development'\n};","lang":"javascript","description":"Shows typical webpack config using the plugin to glob for entry files, ignore tests, and enable watch mode."},"warnings":[{"fix":"Upgrade to Node.js >=18 or continue using v2.x if you need older Node support.","message":"Dropped support for Node.js <18 in v3.0.0. Older versions (2.x) support Node 10 and 12.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use webpack 5 and Node >=18.","message":"v3.0.0 dropped support for Node 12 and added support for Node 20 and 21. Requires webpack 5.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"For rename detection, ensure you are using webpack's watch mode and the plugin is instantiated.","message":"The getEntries method uses glob.sync() under the hood, so changes to the filesystem (addition/removal of files) will be detected during watch mode, but not if a file is renamed (unless you add/remove).","severity":"gotcha","affected_versions":"*"},{"fix":"Upgrade to webpack 5 if still on webpack 4 and using v3+.","message":"Using webpack 4 may be deprecated in future versions; current versions require webpack 5.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Use require() or configure your bundler to handle CommonJS modules.","message":"The plugin does not support ESM imports. It is a CommonJS package only.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install the package: npm install --save-dev webpack-watched-glob-entries-plugin. If using ESM, use createRequire or dynamic import.","cause":"Package not installed or incorrectly imported in ESM project.","error":"Cannot find module 'webpack-watched-glob-entries-plugin'"},{"fix":"Use WebpackWatchedGlobEntries.getEntries (static method), not new WebpackWatchedGlobEntries().getEntries.","cause":"Trying to call getEntries on an instance instead of the class.","error":"TypeError: WebpackWatchedGlobEntries.getEntries is not a function"},{"fix":"Ensure only one instance of new WebpackWatchedGlobEntries() is in the plugins array.","cause":"Multiple instances of the plugin added to webpack config.","error":"HookWebpackError: Plugin tried to register a hook that is already registered"},{"fix":"Pass an array with at least one glob string to getEntries().","cause":"Empty array passed to getEntries or no patterns provided.","error":"Error: You must provide at least one glob pattern"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}