1.0.6 • Published 1 year ago

vite-plugin-child-process v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

vite-plugin-child-process

Vite plugin to run command when file change. Useful when script use local binary or have stateful behavior like websocket.

// vite.config.js
import { child_process } from 'vite-plugin-child-process'

export default {
  plugins: [
    child_process({
      name: "my-backend-server",
      command: ["node", "./backend_server.js"],
      watch: [/src/, /controller/]
    })
  ]
};

Parameters

export interface VitePluginChildProcess {
  /** command name for prefix log ouput @default "untitle" */
  name?: string;
  /** command to run */
  command: string[];
  /** @default 10ms */
  delay?: number;
  /** vite watch file change */
  watch: (RegExp | string)[];
  /** @default true */
  log_enable?: boolean;
}

Environment

this plugin use debug module to log, specify environment DEBUG= will show stdout/stderr of command.

DEBUG=vite:child-process:*

Footnote

PR and issue always wellcome

1.0.6

1 year ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago