MCPcopy
hub / github.com/alex8088/electron-vite

github.com/alex8088/electron-vite @v5.0.0 sqlite

repository ↗ · DeepWiki ↗ · release v5.0.0 ↗
141 symbols 317 edges 25 files 0 documented · 0%
README

electron-vite

Next generation Electron build tooling based on Vite

license

Documentation | Getting Started | create-electron

中文文档

Features

  • ⚡️ Vite powered and use the same way.
  • 🛠 Pre-configure with sensible defaults optimized for Electron.
  • 💡 Optimize asset handling for Electron main process.
  • 🚀 Fast HMR & hot reloading.
  • 🔥 Isolated build for multi-entry application development.
  • ✨ Simplify multi-threading development.
  • 🔒 Compile code to v8 bytecode to protect source code.
  • 🔌 Easy to debug in IDEs such as VSCode or WebStorm.
  • 📦 Out-of-the-box support for TypeScript, Vue, React, Svelte, SolidJS and more.

Usage

Install

npm i electron-vite -D

Development & Build

In a project where electron-vite is installed, you can use electron-vite binary directly with npx electron-vite or add the npm scripts to your package.json file like this:

{
  "scripts": {
    "start": "electron-vite preview",
    "dev": "electron-vite dev",
    "prebuild": "electron-vite build"
  }
}

Configuration

When running electron-vite from the command line, electron-vite will automatically try to resolve a config file named electron.vite.config.js inside project root. The most basic config file looks like this:

// electron.vite.config.js
export default {
  main: {
    // vite config options
  },
  preload: {
    // vite config options
  },
  renderer: {
    // vite config options
  }
}

Getting Started

Clone the electron-vite-boilerplate or use the create-electron tool to scaffold your project.

npm create @quick-start/electron@latest

Currently supported template presets include:

JavaScript TypeScript
vanilla vanilla-ts
vue vue-ts
react react-ts
svelte svelte-ts
solid solid-ts

Contribution

See Contributing Guide.

License

MIT © alex.wei

Extension points exported contracts — how you extend this code

ProcessEnv (Interface)
(no doc)
node.d.ts
IsolatedEntriesMixin (Interface)
(no doc)
src/config.ts
PackageData (Interface)
(no doc)
src/utils.ts
GlobalCLIOptions (Interface)
(no doc)
src/cli.ts
BytecodeOptions (Interface)
(no doc)
src/plugins/bytecode.ts
ImportMetaEnv (Interface)
(no doc)
node.d.ts
ExternalizeDepsMixin (Interface)
(no doc)
src/config.ts
DevCLIOptions (Interface)
(no doc)
src/cli.ts

Core symbols most depended-on inside this repo

supportESM
called by 6
src/electron.ts
toRelativePath
called by 5
src/utils.ts
loadPackageData
called by 5
src/utils.ts
getElectronMajorVer
called by 4
src/electron.ts
assetPlugin
called by 4
src/plugins/asset.ts
importMetaPlugin
called by 4
src/plugins/importMeta.ts
esmShimPlugin
called by 4
src/plugins/esmShim.ts
resetOutDir
called by 3
src/config.ts

Shape

Function 112
Interface 28
Method 1

Languages

TypeScript100%

Modules by API surface

src/config.ts24 symbols
src/plugins/bytecode.ts17 symbols
src/plugins/isolateEntries.ts15 symbols
src/plugins/electron.ts14 symbols
src/utils.ts11 symbols
src/electron.ts8 symbols
src/plugins/swc.ts6 symbols
src/plugins/modulePath.ts6 symbols
src/plugins/asset.ts6 symbols
node.d.ts6 symbols
src/server.ts5 symbols
src/plugins/worker.ts4 symbols

Dependencies from manifests, versioned

@babel/core7.28.4 · 1×
@babel/plugin-transform-arrow-functions7.27.1 · 1×
@eslint/js9.37.0 · 1×
@rollup/plugin-json6.1.0 · 1×
@rollup/plugin-node-resolve16.0.3 · 1×
@rollup/plugin-typescript12.1.4 · 1×
@swc/core1.13.5 · 1×
@types/babel__core7.20.5 · 1×
@types/node22.18.11 · 1×
cac6.7.14 · 1×
esbuild0.25.11 · 1×
eslint9.37.0 · 1×

For agents

$ claude mcp add electron-vite \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact