rollup-plugin-folder-input
raw JSON → 1.0.1 verified Mon Apr 27 auth: no javascript maintenance
Allows Rollup to accept glob patterns in the `input` option instead of explicit file lists. Version 1.0.1 is stable with no releases for several years. Maintained minimally. Differentiates from @rollup/plugin-multi-entry by preserving individual output files rather than merging inputs into a single bundle. Requires separate Rollup installation.
Common errors
error Error: Could not resolve entry module ↓
cause Glob pattern did not match any files or relative path is wrong.
fix
Verify file existence and adjust glob pattern or use absolute path.
error Error: The plugin "folderInput" must be placed before other plugins ↓
cause Plugin order violation: folderInput is not first in plugins array.
fix
Move
folderInput() to the beginning of the plugins array. Warnings
gotcha Plugin must be first in the plugins array; otherwise glob input is not resolved before other plugins run. ↓
fix Place `folderInput()` as the first element in the plugins array.
gotcha Input glob patterns are relative to the current working directory, not the Rollup config file location. ↓
fix Use absolute paths or ensure cwd matches expected root.
gotcha Does not support dynamic imports (`import()`) or code-splitting; each matched file is treated as a separate entry point. ↓
fix Use `@rollup/plugin-multi-entry` if you need merging inputs into a single bundle.
Install
npm install rollup-plugin-folder-input yarn add rollup-plugin-folder-input pnpm add rollup-plugin-folder-input Imports
- folderInput wrong
import folderInput from 'rollup-plugin-folder-input'correctimport { folderInput } from 'rollup-plugin-folder-input'
Quickstart
// rollup.config.js
import { folderInput } from 'rollup-plugin-folder-input';
export default {
input: './src/**/*.js',
output: {
dir: './dist',
format: 'esm',
},
plugins: [folderInput()],
};