Registry /
devops / serverless-rollup-plugin
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–223 runs
build_error
glibcnode 18–223 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default (plugin)
✓ plugins:
- serverless-rollup-plugin
✗ plugins:
- serverlessRollupPlugin
Plugin is referenced by its npm package name in serverless.yml. No JavaScript import needed.
Rollup config export
✓ export default { /* rollup config */ }
✗ module.exports = { /* rollup config */ }
Rollup configs can be ESM; the plugin uses rollup's loadConfigFile internally. CommonJS also works but ESM is recommended.
Function dependencies
✓ testFunction:
handler: src/handler.handler
dependencies:
- aws-xray-sdk-core
✗ testFunction:
handler: src/handler.handler
include:
- aws-xray-sdk-core
Use 'dependencies' key, not 'include'. The plugin installs these in the deployment package.
Minimal setup with serverless.yml and rollup.config.js for a Lambda function.
// Pre-requisites: Node.js >=18, serverless >=3.2, rollup installed
// 1. Install the plugin
// npm install --save-dev serverless-rollup-plugin
// 2. serverless.yml
plugins:
- serverless-rollup-plugin
custom:
rollup:
config: rollup.config.js
concurrency: 5
functions:
hello:
handler: src/hello.handler
dependencies:
- source-map-support
// 3. rollup.config.js (ESM)
export default {
input: 'src/hello.js',
output: {
format: 'cjs',
sourcemap: true,
banner: "require('source-map-support').install();"
}
};
// 4. Deploy
// npx serverless deploy
// The plugin will bundle src/hello.js, install source-map-support, and deploy to AWS Lambda.
Errors
Common errors & fixes
Error: ENOENT: no such file or directory, open '/path/to/rollup.config.js'
The plugin cannot find the Rollup config file. Default path is rollup.config.js in the project root.
fixCreate a rollup.config.js file or specify the path using custom.rollup.config in serverless.yml.
Error: Cannot find module 'rollup'
Rollup is not installed as a devDependency or is not in node_modules.
fixInstall rollup: npm install --save-dev rollup
Error: The Serverless Framework plugin "serverless-rollup-plugin" is not recognized
The plugin is not listed in plugins section, or it's misspelled.
fixAdd 'serverless-rollup-plugin' to the plugins array in serverless.yml.
Error: Requested concurrency 5 but only 1 available? (paraphrase) - Out of memory during concurrent builds
Too many concurrent rollup processes for available memory.
fixReduce custom.rollup.concurrency to a lower number (e.g., 2 or 3).
Audit
Dependencies
rolluprequiredPeer dependency for bundling
serverlessrequiredPeer dependency - the Serverless Framework