Vite plugin that allow you to execute script (or any kind of process) after build
NPM
npm install vite-plugin-execute --save-dev
Yarn
yarn add -D vite-plugin-execute
PNPM
pnpm add -D vite-plugin-execute
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.
You can find more examples here
import { defineConfig } from "vite";
import vitePluginExecute from "vite-plugin-execute";
export default defineConfig({
plugins: [
vitePluginExecute()
]
});
import { defineConfig } from "vite";
import vitePluginExecute from "vite-plugin-execute";
import electron from "electron";
export default defineConfig({
plugins: [
vitePluginExecute({
command: electron,
args: ["./main.js"]
})
]
});