{"id":22220,"library":"rollup-plugin-shell","title":"rollup-plugin-shell","description":"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.","status":"active","version":"1.0.9","language":"javascript","source_language":"en","source_url":"https://github.com/HenrikDK2/rollup-plugin-shell","tags":["javascript","rollup","plugin","node commands","shell commands","shell","execute","commands","rollup plugin execute shell","typescript"],"install":[{"cmd":"npm install rollup-plugin-shell","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-shell","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-shell","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for plugin usage.","package":"rollup","optional":true}],"imports":[{"note":"Package uses default export only; named import will result in undefined.","wrong":"import { execute } from 'rollup-plugin-shell'","symbol":"execute","correct":"import execute from 'rollup-plugin-shell'"},{"note":"CommonJS require returns the default export directly, not an object.","wrong":"const { execute } = require('rollup-plugin-shell')","symbol":"execute","correct":"const execute = require('rollup-plugin-shell')"},{"note":"TypeScript type import; valid for type-checking plugin options.","wrong":null,"symbol":"ShellPluginOptions","correct":"import type { ShellPluginOptions } from 'rollup-plugin-shell'"}],"quickstart":{"code":"import execute from 'rollup-plugin-shell';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/index.js',\n  },\n  plugins: [\n    execute({ commands: ['echo \"Build complete\"'], hook: 'buildStart' }),\n  ],\n};","lang":"typescript","description":"Basic usage of rollup-plugin-shell to execute a shell command at the buildStart hook."},"warnings":[{"fix":"Set sync: false (default) to run commands asynchronously.","message":"Using sync: true blocks the event loop; avoid in production builds for long-running commands.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use absolute paths or change cwd via ShellJS or other means before invoking.","message":"Commands are executed in the project root by default; relative paths may not work as expected.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always provide at least one command string.","message":"No validation on commands array; empty array or missing commands option silently does nothing.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `import execute from 'rollup-plugin-shell'` (without braces).","cause":"Using named import instead of default import.","error":"TypeError: execute is not a function"},{"fix":"Run `npm install rollup-plugin-shell --save-dev`.","cause":"Package not installed or not installed as devDependency.","error":"Error: Cannot find module 'rollup-plugin-shell'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}