{"id":22284,"library":"rollup-plugin-watch-external","title":"rollup-plugin-watch-external","description":"Rollup plugin to add additional files (e.g., assets, configs) to Rollup's watch list. Version 1.0.2 requires Rollup ^2.39.0. Minimal API: one option `entries` (array of glob patterns). Does not handle incremental rebuilds; simply triggers rebuild on changes to specified files. For a more feature-rich alternative, consider @rollup/plugin-watch or custom chokidar integration.","status":"active","version":"1.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/arpitchakladar/rollup-plugin-watch-external","tags":["javascript"],"install":[{"cmd":"npm install rollup-plugin-watch-external","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-watch-external","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-watch-external","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency – plugin requires Rollup >=2.39.0","package":"rollup","optional":true}],"imports":[{"note":"This package exports a named function, not a default export.","wrong":"import watchExternal from 'rollup-plugin-watch-external'","symbol":"watchExternal","correct":"import { watchExternal } from 'rollup-plugin-watch-external'"},{"note":"CommonJS require should use destructuring to get the named export.","wrong":"const watchExternal = require('rollup-plugin-watch-external')","symbol":"watchExternal","correct":"const { watchExternal } = require('rollup-plugin-watch-external')"},{"note":"Do not use namespace import; the module only has a named export.","wrong":"import * as watchExternal from 'rollup-plugin-watch-external'","symbol":"watchExternal","correct":"import { watchExternal } from 'rollup-plugin-watch-external'"}],"quickstart":{"code":"// rollup.config.js\nimport { watchExternal } from 'rollup-plugin-watch-external';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/bundle.js',\n    format: 'iife'\n  },\n  plugins: [\n    watchExternal({\n      entries: ['public/**.js', 'data/*.json']\n    })\n  ]\n};","lang":"javascript","description":"Shows basic setup with named import, glob patterns for JS and JSON files in watch list."},"warnings":[{"fix":"Upgrade Rollup to at least 2.39.0 or use a different watch plugin.","message":"Package requires Rollup ^2.39.0; incompatible with Rollup 1.x or early 2.x releases.","severity":"breaking","affected_versions":"rollup <2.39.0"},{"fix":"Test your glob patterns (e.g., with `glob` package) before adding to plugin options.","message":"The `entries` option uses glob patterns; if no files match, the plugin still adds the pattern but may not trigger builds. Ensure globs match existing files.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run `npm install rollup-plugin-watch-external --save-dev` or `yarn add -D rollup-plugin-watch-external`.","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'rollup-plugin-watch-external'"},{"fix":"Change to `import { watchExternal } from 'rollup-plugin-watch-external'`.","cause":"Using default import instead of named import.","error":"TypeError: watchExternal is not a function"},{"fix":"Update Rollup: `npm install rollup@latest --save-dev`.","cause":"Installed Rollup version is too old.","error":"Error: Rollup version mismatch: expected >=2.39.0, got 2.20.0"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}