Registry / devops / rollup-plugin-shell

rollup-plugin-shell

JSON →
library1.0.9jsnpmunverified

Rollup plugin to execute arbitrary shell commands during the build process. Version 1.0.9 is the latest stable release. Allows specifying commands as strings or arrays and hooks into any Rollup build hook (default: generateBundle). Supports synchronous and asynchronous execution. Differentiators: minimal API, supports single or multiple commands, flexible hook integration. Designed for tasks like linting, copying files, or running dev servers.

npm install rollup-plugin-shell
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-SHEL
R
rollup-plugin-shell
devopsjavascriptv1.0.9
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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
musl
node 18–223 runs
build_error
glibc
node 18–223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

execute
✓ import execute from 'rollup-plugin-shell'
✗ import { execute } from 'rollup-plugin-shell'
Package uses default export only; named import will result in undefined.
execute
✓ const execute = require('rollup-plugin-shell')
✗ const { execute } = require('rollup-plugin-shell')
CommonJS require returns the default export directly, not an object.
ShellPluginOptions
✓ import type { ShellPluginOptions } from 'rollup-plugin-shell'
TypeScript type import; valid for type-checking plugin options.

Basic usage of rollup-plugin-shell to execute a shell command at the buildStart hook.

import execute from 'rollup-plugin-shell'; export default { input: 'src/index.js', output: { file: 'dist/index.js', }, plugins: [ execute({ commands: ['echo "Build complete"'], hook: 'buildStart' }), ], };
Debug
Known issues
gotchaUsing sync: true blocks the event loop; avoid in production builds for long-running commands.
fix
Set sync: false (default) to run commands asynchronously.
affects: >=1.0.0
gotchaCommands are executed in the project root by default; relative paths may not work as expected.
fix
Use absolute paths or change cwd via ShellJS or other means before invoking.
affects: >=1.0.0
gotchaNo validation on commands array; empty array or missing commands option silently does nothing.
fix
Always provide at least one command string.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: execute is not a function
Using named import instead of default import.
fix
Use `import execute from 'rollup-plugin-shell'` (without braces).
Error: Cannot find module 'rollup-plugin-shell'
Package not installed or not installed as devDependency.
fix
Run `npm install rollup-plugin-shell --save-dev`.
Upgrade
Version history
1.0.9latest on npm
Audit
Dependencies
rollupoptionalPeer dependency required for plugin usage.
Agent activity
6 hits · last 30 days
node
6
Resources
rollup-plugin-shell — npm install rollup-plugin-shell · libregistry