rollup-plugin-executable-output

1.3.0 • Public • Published

Executable Rollup bundles

Mark bundles as executable with chmod 755. Existing plugins had bugs or used outdated APIs. Recommended to use alongside rollup-plugin-preserve-shebang.

Example

In rollup.config.js:

export default [
  {
    input: 'config/exports.js',
    output: [
      {
        file: 'dist/exports.cjs',
        format: 'cjs',
      },
      {
        file: 'dist/exports.mjs',
        format: 'esm',
      },
    ],
  },
  {
    input: 'lib/cli.js',
    output: [
      {
        file: 'dist/cli.mjs',
        format: 'esm',
      },
      {
        file: 'dist/cli.cjs',
        format: 'cjs',
      },
    ],
    plugins: [
      shebang(),
      executable(),
    ],
  },
];

This example shows a complex config which generates multiple bundles and multiple outputs per bundle; the cli.mjs and cli.cjs outputs from the second bundle are passed the shebang and executable plugins, and the first bundle (consisting of two outputs as well) is passed none.

/rollup-plugin-executable-output/

    Package Sidebar

    Install

    npm i rollup-plugin-executable-output

    Weekly Downloads

    304

    Version

    1.3.0

    License

    MIT

    Unpacked Size

    2.72 kB

    Total Files

    4

    Last publish

    Collaborators

    • ctjlewis