# rollup-plugin-shell

> Execute shell commands in Rollup.

Latest version **1.0.9** (published 2022-11-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install rollup-plugin-shell
pnpm add rollup-plugin-shell
yarn add rollup-plugin-shell
bun add rollup-plugin-shell
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2022-11-30 |
| First published | 2021-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Henrik Mundt Milo |
| Maintainers | henrikdk |
| Keywords | rollup, plugin, node commands, shell commands, shell, execute, commands, rollup plugin execute shell, rollup plugin execute, rollup plugin shell |

## Links

- npm: https://www.npmjs.com/package/rollup-plugin-shell
- Homepage: https://github.com/HenrikDK2/rollup-plugin-shell
- Issues: https://github.com/HenrikDK2/rollup-plugin-shell/issues
- npm.io page: https://npm.io/package/rollup-plugin-shell

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.0.9 (latest) — 2022-11-30
- 1.0.8 — 2022-07-19
- 1.0.7 — 2022-07-19
- 1.0.6 — 2022-06-23
- 1.0.5 — 2022-06-23
- 1.0.4 — 2022-06-23
- 1.0.3 — 2021-02-21
- 1.0.2 — 2021-02-21
- 1.0.1 — 2021-02-21
- 1.0.0 — 2021-02-21

## README

# rollup-plugin-shell

Execute shell commands in Rollup.

## Install

```bash
npm i rollup-plugin-shell --save-dev
```

## Options

| Name     | Type            | Default          | Description                                                                                                                                                          |
| -------- | --------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| commands | `array<string>` | `undefined`      | An array of shell commands that will be executed. This is required, since no commands would run.                                                                     |
| hook     | `string`        | `generateBundle` | Any Rollup hook - https://rollupjs.org/guide/en/#build-hooks.                                                                                                        |
| sync     | `boolean`       | `false`          | Spawns the child process asynchronously, without blocking the event loop. Sync `true` blocks the event loop until the spawned process either exits or is terminated. |

## Example:

```js
import execute from "rollup-plugin-shell";

export default {
  input: "src/index.js",
  output: {
    file: "dist/index.js",
  },
  plugins: [
    // Run mulitple commands with a specific rollup hook
    execute({ commands: ["eslint src"], hook: "buildStart" }),

    // Run multiple commands with the default rollup hook
    execute([
      "copyfiles dist/**/* example/package -u 1",
      "live-server --watch=example --open=example",
    ]),

    // Run a single command with the default rollup hook
    execute("npm run test"),
  ],
};
```

---
_Source: https://npm.io/package/rollup-plugin-shell · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
