Compare commits

...

5 Commits

Author SHA1 Message Date
Byc
4ea9f805f9
Merge 8723add7a680391d3a1977e24ecd0cf9f6196fd0 into 91368b665518b9ceecf7240ed93c1078bfa54447 2025-12-08 16:11:11 +05:30
alex8088
91368b6655 release: v5.0.0 2025-12-07 22:26:56 +08:00
alex8088
b1fd596afe docs: update 2025-11-09 23:31:08 +08:00
alex8088
438e9e7672 chore: fix jsdoc 2025-11-09 23:03:06 +08:00
byc
8723add7a6 feat: return getElectronProcess and getViteServer methods from createServer 2025-09-26 09:22:14 +08:00
5 changed files with 57 additions and 38 deletions

View File

@ -1,49 +1,58 @@
### v5.0.0-beta.3 (_2025-11-01_)
### v5.0.0 (_2025-12-07_)
- feat(config): add `build.externalizeDeps` and `build.bytecode` config options to replace `externalizeDepsPlugin` and `bytecodePlugin`
- feat: reporter plugin for isolated builds
- feat: enhanced string protection
- feat: add `isolatedEntries` option for `preload` and `renderer` to build entries as standalone bundles [#154](https://github.com/alex8088/electron-vite/issues/154)
- refactor(config): move the `isolateEntries` options to the `build` option
- refactor: deprecated `externalizeDepsPlugin` and `bytecodePlugin`
- refactor(config)!: remove function resolution for nested config fields
- perf(buildReport): exclude node_modules from watch list
- fix(modulePath): rewrite the build input instead of merging
### v5.0.0-beta.2 (_2025-10-30_)
- feat: reporter plugin for isolated builds
- perf(isolateEntries): transform log
- perf(isolateEntries): optimize entries transformation
- fix(asset): normalize imported public asset chunk path
- fix: avoid duplicate chunk emission
### v5.0.0-beta.1 (_2025-10-29_)
- feat: enhanced string protection
- feat: add `isolatedEntries` option for `preload` and `renderer` to build entries as standalone bundles [#154](https://github.com/alex8088/electron-vite/issues/154)
- refactor(asset): remove redundant path normalization
- refactor: split electron plugin into preset and validator plugins
- refactor(config)!: restructure Electron Vite config interfaces
- refactor(build): simplify build logic
- refactor: replace `JSON.parse/stringify` with manual deep clone
- perf: build compatibility target for Electron 39
- fix(modulePath): prevent duplicate asset emission
- fix(modulePath): support watch mode
- chore: improve logging message clarity and consistency
### v5.0.0-beta.0 (_2025-10-19_)
- refactor(bytecodePlugin): improved bytecode bundle generation and made a new string protection plugin
- refactor(modulePath): better support for tree-shaking and code-splitting
- refactor: remove Electron 18, 19, 20, 21 build compatilibity target
- perf(buildReport): exclude node_modules from watch list
- perf(isolateEntries): transform log
- perf(isolateEntries): optimize entries transformation
- perf: build compatibility target for Electron 39
- perf(plugin): more efficient module filtering via regular expressions
- perf(plugin): no need to cache `sourcemap` option
- perf(plugin): lazily initialize `MagicString` and remove the redundant pre-check
- perf(bytecodePlugin): better way to count bytecode chunks
- perf(plugin): enhance path resolution using `import.meta.dirname` for ES modules
- fix(modulePath): rewrite the build input instead of merging
- fix(asset): normalize imported public asset chunk path
- fix: avoid duplicate chunk emission
- fix(modulePath): prevent duplicate asset emission
- fix(modulePath): support watch mode
- chore: fix jsdoc
- chore: improve logging message clarity and consistency
- chore(deps): update all non-major dependencies
- chore: update eslint config
- chore: replace `tseslint.config` with `defineConfig`
- chore: remove redundant external id
- chore: rename the file `esm` to `esmShim`
- docs: update
### v5.0.0-beta.3 (_2025-11-01_)
See [v5.0.0-beta.3 changelog](https://github.com/alex8088/electron-vite/blob/v5.0.0-beta.3/CHANGELOG.md)
### v5.0.0-beta.2 (_2025-10-30_)
See [v5.0.0-beta.2 changelog](https://github.com/alex8088/electron-vite/blob/v5.0.0-beta.2/CHANGELOG.md)
### v5.0.0-beta.1 (_2025-10-29_)
See [v5.0.0-beta.1 changelog](https://github.com/alex8088/electron-vite/blob/v5.0.0-beta.1/CHANGELOG.md)
### v5.0.0-beta.0 (_2025-10-19_)
See [v5.0.0-beta.0 changelog](https://github.com/alex8088/electron-vite/blob/v5.0.0-beta.0/CHANGELOG.md)
### v4.0.1 (_2025-09-21_)

View File

@ -28,13 +28,13 @@
## Features
- ⚡️ [Vite](https://vitejs.dev) powered and use the same way.
- 🛠 Pre-configured for Electron, don't worry about configuration.
- 💡 Optimize asset handling (Node.js addons, WebAssembly, Worker Thread, etc).
- 🚀 Fast HMR for renderer processes.
- 🔥 Hot reloading for main process and preload scripts.
- 🔌 Easy to debug in IDEs like VSCode or WebStorm.
- 🔒 Compile to v8 bytecode to protect source code.
- 🏷️ Support for TypeScript decorators.
- 🛠 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
@ -83,7 +83,7 @@ export default {
Clone the [electron-vite-boilerplate](https://github.com/alex8088/electron-vite-boilerplate) or use the [create-electron](https://github.com/alex8088/quick-start/tree/master/packages/create-electron) tool to scaffold your project.
```bash
npm create @quick-start/electron
npm create @quick-start/electron@latest
```
Currently supported template presets include:

View File

@ -1,6 +1,6 @@
{
"name": "electron-vite",
"version": "5.0.0-beta.3",
"version": "5.0.0",
"description": "Electron build tooling based on Vite",
"type": "module",
"main": "./dist/index.js",

View File

@ -69,7 +69,7 @@ interface ExternalizeDepsMixin {
interface BytecodeMixin {
/**
* Options pass on to `bytecode` plugin in electron-vite.
* https://electron-vite.org/guide/source-code-protection#bytecodeplugin-options
* https://electron-vite.org/guide/source-code-protection#options
*
* Compile source code to v8 bytecode.
*/

View File

@ -12,18 +12,23 @@ import { type InlineConfig, resolveConfig } from './config'
import { resolveHostname } from './utils'
import { startElectron } from './electron'
type ElectronViteDevServer = {
getElectronProcess: () => ChildProcess | undefined
getViteServer: () => ViteDevServer | undefined
}
export async function createServer(
inlineConfig: InlineConfig = {},
options: { rendererOnly?: boolean }
): Promise<void> {
options: { rendererOnly?: boolean } = {}
): Promise<ElectronViteDevServer> {
process.env.NODE_ENV_ELECTRON_VITE = 'development'
const config = await resolveConfig(inlineConfig, 'serve', 'development')
let server: ViteDevServer | undefined
let ps: ChildProcess | undefined
if (config.config) {
const logger = createLogger(inlineConfig.logLevel)
let server: ViteDevServer | undefined
let ps: ChildProcess | undefined
const errorHook = (e): void => {
logger.error(`${colors.bgRed(colors.white(' ERROR '))} ${colors.red(e.message)}`)
}
@ -104,6 +109,11 @@ export async function createServer(
logger.info(colors.green(`\nstarting electron app...\n`))
}
return {
getElectronProcess: () => ps,
getViteServer: () => server
}
}
type UserConfig = ViteConfig & { configFile?: string | false }