vite-plugin-execute
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

vite-plugin-execute

Vite plugin that allow you to execute script (or any kind of process) after build


Installation

NPM

npm install vite-plugin-execute --save-dev

Yarn

yarn add -D vite-plugin-execute

PNPM

pnpm add -D vite-plugin-execute

API

export interface VitePluginExecuteOption {
  command?: string; // default: "node"
  args?: string[];  // default: "[.]" -- equal to node .
  cwd?: string;     // default vite's outDir
  spawnOptions?: ChildProcess.SpawnOptions;
}

You can read more about spawnOptions on official NodeJS documentation.

Usage

You can find more examples here

Basic

import { defineConfig } from "vite";
import vitePluginExecute from "vite-plugin-execute";

export default defineConfig({
  plugins: [
    vitePluginExecute()
  ]
});

Execute Electron

import { defineConfig } from "vite";
import vitePluginExecute from "vite-plugin-execute";
import electron from "electron";

export default defineConfig({
  plugins: [
    vitePluginExecute({
      command: electron,
      args: ["./main.js"]
    })
  ]
});

Package Sidebar

Install

npm i vite-plugin-execute

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

5.48 kB

Total Files

7

Last publish

Collaborators

  • thetyin