177 Commits

Author SHA1 Message Date
Steve Zhu
62956e3894
fix: externalize electron via ssr.external for Vite 8
In Vite 8, rollupOptions.external is not honored when rolldownOptions
exists separately. Use ssr.external to ensure electron is externalized
in both main and preload SSR builds, since ssr.external takes
precedence over ssr.noExternal for specified packages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 19:32:00 -04:00
Steve Zhu
8660e7ac5e
feat: add Vite 8 support
Vite 8 replaces Rollup with Rolldown, which removes the
`resolveImportMeta` hook. Add a `renderChunk` fallback in the
importMeta plugin so `import.meta.url/filename/dirname` are still
rewritten to CJS equivalents. The existing `resolveImportMeta` hook
is kept for Vite 5-7 backward compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 17:05:17 -04:00
alex8088
78a117d5be perf: build compatibility target for Electron 40, 41 2026-03-21 14:36:18 +08:00
Michal Fudala
5a8bbe3d0e
fix(isolateEntries): handle non-TTY stdout in build reporter (#887)
The `clearLine` and `writeLine` helpers use TTY-only methods (`clearLine`, `cursorTo`,
`moveCursor`) without checking `process.stdout.isTTY`, causing builds to crash in
non-interactive environments like CI or piped output.

See error I got in my CI environment:

```
vite v7.3.1 building ssr environment for production...
✗ Build failed in 7ms
✓ 0 modules transformed.
✗ Build failed in 9ms
error during build:
[vite:isolate-entries] Could not load virtual:isolate-entries:
  [vite:transform-reporter] process.stdout.clearLine is not a function
```
2026-02-16 22:25:35 +08:00
alex8088
438e9e7672 chore: fix jsdoc 2025-11-09 23:03:06 +08:00
alex8088
465690ab0d refactor(config)!: remove function resolution for nested config fields 2025-10-31 23:28:40 +08:00
alex8088
6aae37833e perf(buildReport): exclude node_modules from watch list 2025-10-31 21:59:15 +08:00
alex8088
9152dfc943 fix(modulePath): rewrite the build input instead of merging 2025-10-31 01:16:10 +08:00
alex8088
0276407b5b refactor: deprecated externalizeDepsPlugin and bytecodePlugin 2025-10-31 01:16:02 +08:00
alex8088
fe7e631f47 refactor(config): move the isolateEntries options to the build option 2025-10-31 01:09:44 +08:00
alex8088
08be346407 feat(config): add build.externalizeDeps and build.bytecode config options to replace externalizeDepsPlugin and bytecodePlugin 2025-10-31 01:03:34 +08:00
alex8088
1bba6766e8 perf(isolateEntries): optimize entries transformation 2025-10-29 23:35:38 +08:00
alex8088
4edffe3b9a perf(isolateEntries): transform log 2025-10-29 23:25:28 +08:00
alex8088
cfd9812a91 feat: reporter plugin for isolated builds 2025-10-29 22:32:35 +08:00
alex8088
7c7f31b2a3 fix: avoid duplicate chunk emission 2025-10-29 21:22:12 +08:00
alex8088
ae57b2489a fix(asset): normalize imported public asset chunk path 2025-10-29 21:12:13 +08:00
alex8088
a4f7693712 perf: build compatibility target for Electron 39 2025-10-29 00:08:03 +08:00
alex8088
56fb519092 refactor: replace JSON.parse/stringify with manual deep clone 2025-10-28 23:18:45 +08:00
alex8088
eb0a7e3ffe refactor(build): simplify build logic 2025-10-28 22:53:03 +08:00
alex8088
de70dfe1dc refactor(config)!: restructure Electron Vite config interfaces 2025-10-28 22:36:25 +08:00
alex8088
8892bf3679 fix(modulePath): support watch mode 2025-10-28 21:50:54 +08:00
alex8088
2576484604 chore: improve logging message clarity and consistency 2025-10-28 21:50:47 +08:00
alex8088
88f6db2239 refactor: split electron plugin into preset and validator plugins 2025-10-28 21:50:12 +08:00
alex8088
0a79da03db feat: add isolatedEntries option for preload and renderer to build entries as standalone bundles #154 2025-10-27 23:40:01 +08:00
alex8088
c3939ade45 refactor(asset): remove redundant path normalization 2025-10-24 23:57:12 +08:00
alex8088
38228f9b3f fix(modulePath): prevent duplicate asset emission 2025-10-24 22:10:03 +08:00
alex8088
8b193864fd feat: enhanced string protection 2025-10-20 23:35:21 +08:00
alex8088
5debb6f83b refactor: remove Electron 18, 19, 20, 21 build compatilibity target 2025-10-19 16:00:01 +08:00
alex8088
d530597339 chore: rename the file esm to esmShim 2025-10-19 15:53:19 +08:00
alex8088
a9b5326544 perf(plugin): enhance path resolution using import.meta.dirname for ES modules 2025-10-19 15:47:35 +08:00
alex8088
7587d2c674 perf(bytecodePlugin): better way to count bytecode chunks 2025-10-19 14:49:09 +08:00
alex8088
0fb8918090 perf(plugin): lazily initialize MagicString and remove the redundant pre-check 2025-10-19 14:42:35 +08:00
alex8088
c7955aa6fd perf(plugin): no need to cache sourcemap option 2025-10-19 12:11:29 +08:00
alex8088
70e027d38a perf(plugin): more efficient module filtering via regular expressions 2025-10-19 11:57:23 +08:00
alex8088
28bb22b353 refactor(modulePath): better support for tree-shaking and code-splitting 2025-10-18 17:10:04 +08:00
alex8088
327adc23df refactor(bytecodePlugin): improved bytecode bundle generation and made a new string protection plugin 2025-10-18 16:33:49 +08:00
alex8088
0badfc493f chore: update eslint config 2025-10-17 21:28:47 +08:00
alex8088
b55eb725c4 perf: build compatibility target for Electron 38 2025-09-21 16:52:57 +08:00
alex8088
cbee52c8bb perf: build compatibility target for Electron 37 2025-06-28 13:12:31 +08:00
alex8088
48e6f4f570 fix(deps)!: update Vite to v7 and remove cjs build 2025-06-28 13:08:38 +08:00
alex8088
4071778f07 fix: use import type for type-only imports 2025-06-28 00:01:48 +08:00
alex8088
3fd16d0c23 refactor!: bump required node version to 20.19+, 22.12+ 2025-06-27 23:10:23 +08:00
jonz94
3d5c9f68a1
perf: build compatibility target for Electron 36 (#766) 2025-05-06 10:12:44 +08:00
alex8088
b56d3c2d21 fix(bytecodePlugin): optimize 'use strict' directive replacement (#681) 2025-03-16 19:24:22 +08:00
jonz94
ea144aef19
perf: build compatibility target for Electron 35 2025-03-09 04:16:52 +08:00
alex8088
6e8572d9b7 feat: resolve conditions for preload 2025-01-22 22:24:04 +08:00
alex8088
4b47ef0bd4 perf: build compatilibity target for Electron 34 2025-01-22 21:16:13 +08:00
alex8088
dfe6a3e3f8 chore(deps): update all non-major dependencies 2025-01-22 01:04:31 +08:00
alex8088
6c01417909 chore: move to eslint flat config 2025-01-22 00:47:48 +08:00
kye shimizu
5ffd49eddc
perf: build compatilibity target for Electron 33 (#651) 2024-11-11 23:49:02 +08:00