A Rollup plugin that resolves webpack-style require-context calls, enabling dynamic module loading in Rollup bundles. Current stable version is 1.0.1, with irregular releases. Key differentiators: allows migration from webpack to Rollup without rewriting require-context usage, supports RegExp filtering and recursive directory traversal. Alternative to manual import() or glob imports.
npm install rollup-plugin-require-contextVerified import paths — ran on the pinned version, not inferred.
Shows basic setup of the plugin in a Rollup config to enable require-context resolution.
Use static directory and RegExp patterns. Avoid dynamic variables in the directory argument.
Specify a narrow directory or use a strict RegExp filter.
Ensure directory exists relative to the file and the regex is valid. Use absolute path if needed.
Use default import: import requireContext from 'rollup-plugin-require-context'
No dependency data recorded yet.