Skip to content

Latest commit

 

History

History
44 lines (35 loc) · 670 Bytes

README.md

File metadata and controls

44 lines (35 loc) · 670 Bytes

vite-plugin-electron-preload

A Vite preset adapted to Electron preload

Install

npm i vite-plugin-electron-preload -D

Usage

import electronPreload from 'vite-plugin-electron-preload'

// vite.config.js
export default {
  plugins: [
    electronPreload(/* options */),
  ],
}

API (Define)

electronPreload(options: PreloadOptions)

export interface PreloadOptions {
  /**
   * Must be consistent with the following config.
   * 
   * ```js
   * new BrowserWindow({
   *   webPreferences: {
   *     sandbox: boolean
   *   }
   * })
   * ```
   */
  sandbox?: boolean
  type?: 'commonjs' | 'module'
}