0.1.6 • Published 2 years ago

vite-plugin-shebang v0.1.6

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

vite-plugin-shebang

A Vite plugin to prepend a custom shebang to JavaScript files based on the module type specified in package.json.

Features

  • Prepends a custom shebang to JavaScript files
  • Automatically detects bin files based on the bin field in package.json

Installation

Install the plugin via npm:

npm install vite-plugin-shebang --save-dev

Usage

Specify your options:

const options: PrependShebangOptions = {
    // The shebang string to prepend to the file.
    shebang: "#!/usr/bin/env node",
    // The output file names to prepend the shebang to.
    files: ["index.cjs"],
};

And then call the plugin in your build chain:

// vite.config.ts
import { defineConfig } from "vite";
import { prependShebang } from "vite-plugin-shebang";

export default defineConfig({
    plugins: [prependShebang(options)],
});
0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago