1.0.2 • Published 4 years ago

rollup-plugin-execute-shell v1.0.2

Weekly downloads
164
License
MIT
Repository
-
Last release
4 years ago

rollup-plugin-execute-shell

Execute shell commands in Rollup.

Install

npm i rollup-plugin-execute-shell --save-dev

Options

  • Commands - An array of shell commands.
  • Hook (default generateBundle) - Any Rollup hook - https://rollupjs.org/guide/en/#build-hooks.
  • Sync (default false) - Sync 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:

import execute from "./rollup-execute-plugin";

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

    //You can also just use a string array.
    execute([
      "copyfiles dist/**/* example/package -u 1",
      "live-server --watch=example --open=example",
    ]),

    //You can also do a one liner.
    execute("npm run test"),
  ],
};