Files
nl-admin-view/apps/desktop/electron.vite.config.ts
李琦 318aeab092
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
AI代码生成工具、个人中心
2026-08-13 19:04:28 +08:00

35 lines
1.1 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { defineConfig } from 'electron-vite';
/**
* electron-vite 构建配置
*
* 为什么不配置 renderer
* 渲染层不由本工程构建——开发期直接加载 web-antd 的 vite dev serverhttp://localhost:14002
* 生产期通过 app:// 自定义协议加载 web-antd 的生产 distelectron-builder extraResources 拷入)。
*
* 为什么不用 externalizeDepsPlugin
* 故意把 electron-updater / electron-log / electron-store 等运行时依赖全部打进 out/ 产物,
* 使应用的 dependencies 为空electron-builder 无需收集 node_modules
* 从而规避 pnpm 软链目录结构在打包期的兼容问题asar 里只有 out/ 与 package.json
*/
export default defineConfig({
main: {
build: {
outDir: 'out/main',
},
},
preload: {
build: {
outDir: 'out/preload',
rollupOptions: {
output: {
// sandbox: true 的 preload 必须是 CommonJSElectron 硬性限制),
// 这里锁定输出为 index.cjs主进程按该文件名引用
format: 'cjs',
entryFileNames: '[name].cjs',
},
},
},
},
});