A Rollup plugin that extends the watch mode to monitor arbitrary file globs (e.g., static assets, stylesheets, HTML) not in the module graph. Currently v2.0.1, maintained by Caleb Evans. Key differentiator: unlike relying on Rollup's default watch (which only tracks JS/TS files in the dependency graph), this plugin explicitly adds glob patterns to trigger rebuilds, complementing tools like rollup-plugin-copy. Released under MIT License, requires rollup >=2.0.0 as a peer dependency. A lightweight, focused solution with no runtime dependencies beyond rollup.
npm install rollup-plugin-watch-globsVerified import paths — ran on the pinned version, not inferred.
Shows how to import and configure watchGlobs with two glob patterns to watch static assets and stylesheets.
Ensure the argument is an array: watchGlobs(['**/*.css'])
Combine with appropriate plugins for actions on change.
Use import watchGlobs from 'rollup-plugin-watch-globs' and call it directly.
Use: import watchGlobs from 'rollup-plugin-watch-globs' (ESM) or const watchGlobs = require('rollup-plugin-watch-globs').default (CJS).Wrap glob pattern in an array: watchGlobs(['public/**/*.*'])