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

0.2.0 • Public • Published

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'
}

/vite-plugin-electron-preload/

    Package Sidebar

    Install

    npm i vite-plugin-electron-preload

    Weekly Downloads

    1

    Version

    0.2.0

    License

    none

    Unpacked Size

    15.5 kB

    Total Files

    7

    Last publish

    Collaborators

    • caoxie