vite-plugin-erb
Version:
Use ERB files in Vite.js projects with a Ruby backend
38 lines (35 loc) • 1.09 kB
TypeScript
import { Plugin } from 'vite';
type Engine = 'erubi' | 'erubis' | 'erb';
interface Options {
/**
* ERB Template engine, "erubi", "erubis" and "erb" are supported.
* @default 'erubi' if available, fallback to 'erb'
*/
engine?: Engine;
/**
* Command to run Ruby scripts.
* @default auto-detected
*/
runner?: string;
/**
* Additional environment variables to be passed to runner.
* NOTE: Set extendEnv: false to avoid extending `process.env`.
*/
env?: Record<string, string>;
/**
* Set to false if you don't want to extend the environment variables when providing the env property.
* @default true
*/
extendEnv?: boolean;
/**
* If timeout is greater than 0, the Ruby process will be sent a termination
* signal if it doesn't return a result under the specified time in millis.
* @default 0
*/
timeout?: number;
}
/**
* Renders .erb files in the context of a Ruby application.
*/
declare function ErbPlugin(options?: Options): Plugin;
export { ErbPlugin as default };