{"id":20020,"library":"extra-watch-webpack-plugin","title":"Extra Watch Webpack Plugin","description":"A webpack plugin that adds extra files or directories to webpack's watch system, triggering rebuilds when those files change. Version 1.0.3 is the latest stable release, with minimal updates since 1.0.0. Compatible with webpack versions 1 through 4, it supports glob patterns for files and explicit directory paths. Unlike built-in webpack watch options that only track dependencies, this plugin allows any arbitrary file or folder to trigger a rebuild, ideal for configuration files, generated assets, or non-imported resources.","status":"active","version":"1.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/pigcan/extra-watch-webpack-plugin","tags":["javascript","webpack","webpack-plugin","watch"],"install":[{"cmd":"npm install extra-watch-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add extra-watch-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add extra-watch-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; plugin is designed to work with webpack's watch system","package":"webpack","optional":false}],"imports":[{"note":"Package uses default export; CommonJS require() should use require('...').default or use the default import syntax.","wrong":"const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin').default;","symbol":"ExtraWatchWebpackPlugin","correct":"import ExtraWatchWebpackPlugin from 'extra-watch-webpack-plugin';"},{"note":"In CommonJS, the entire module exports the plugin constructor; destructuring is incorrect.","wrong":"const { ExtraWatchWebpackPlugin } = require('extra-watch-webpack-plugin');","symbol":"ExtraWatchWebpackPlugin","correct":"const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin');"},{"note":"TypeScript users may need to import the type for the constructor, but the plugin does not ship types. Use @types/extra-watch-webpack-plugin if available, or declare the module.","wrong":"","symbol":"ExtraWatchWebpackPlugin","correct":"import type ExtraWatchWebpackPlugin from 'extra-watch-webpack-plugin';"}],"quickstart":{"code":"// webpack.config.js\nimport ExtraWatchWebpackPlugin from 'extra-watch-webpack-plugin';\n\nexport default {\n  entry: './src/index.js',\n  output: { filename: 'bundle.js', path: '/dist' },\n  watch: true,\n  plugins: [\n    new ExtraWatchWebpackPlugin({\n      files: [ 'path/to/config.json', 'src/**/*.json' ],\n      dirs: [ 'path/to/extra-directory' ],\n    }),\n  ],\n};","lang":"javascript","description":"Example webpack configuration using ExtraWatchWebpackPlugin to watch additional files and directories beyond the dependency graph."},"warnings":[{"fix":"Switch to webpack's built-in watchOptions.ignored or use another plugin like webpack-watch-files-plugin that supports webpack 5.","message":"The plugin does not support webpack 5 and may cause compatibility issues.","severity":"gotcha","affected_versions":">=5.0.0"},{"fix":"Update config to use array syntax: files: ['path/to/file']","message":"In version 1.0.0, the `files` option changed from a single string to also accept arrays. Using a plain string may still work, but the option is documented as array.","severity":"breaking","affected_versions":"1.0.0"},{"fix":"Consider alternatives like @dolby/extra-watch-webpack-plugin or webpack's native watchOptions.","message":"The plugin is no longer actively maintained; last release was 1.0.3 in 2019.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Ensure all directories passed to `dirs` option exist before starting webpack.","message":"The plugin does not automatically create directories; they must exist at startup.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use explicit paths for hidden files or adjust glob pattern (e.g., '**/.*') and verify with a test.","message":"Glob patterns in `files` may not match hidden files (dotfiles) depending on the glob implementation.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install extra-watch-webpack-plugin --save-dev'","cause":"Package not installed or missing from node_modules.","error":"Module not found: Error: Can't resolve 'extra-watch-webpack-plugin'"},{"fix":"Use 'const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin');'","cause":"Incorrect import; using destructured require or default import in CommonJS without .default.","error":"TypeError: ExtraWatchWebpackPlugin is not a constructor"},{"fix":"Check options: files (array of strings/globs) and dirs (array of path strings).","cause":"Passing unsupported options or invalid option types (e.g., non-array for files).","error":"ValidationError: Invalid configuration object. extra-watch-webpack-plugin has been initialized using a configuration object that does not match the API schema."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}