update
This commit is contained in:
43
electron.vite.config.ts
Normal file
43
electron.vite.config.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { defineConfig, externalizeDepsPlugin } from 'electron-vite';
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
/** 生成 source map,但 electron-builder.yml 已把 *.map 排除在安装包外。
|
||||
* 生产环境崩溃日志靠 `_electronViteSourceMaps` 关联(由 electron-builder 的
|
||||
* sourcemap 处理),本应用先简单出 'hidden' map 留作本地调试。 */
|
||||
const SOURCE_MAP_OPTS = { sourcemap: 'hidden' as const };
|
||||
|
||||
export default defineConfig({
|
||||
main: {
|
||||
plugins: [externalizeDepsPlugin()],
|
||||
build: {
|
||||
...SOURCE_MAP_OPTS,
|
||||
rollupOptions: {
|
||||
input: { index: resolve(__dirname, 'src/main/index.ts') }
|
||||
}
|
||||
}
|
||||
},
|
||||
preload: {
|
||||
plugins: [externalizeDepsPlugin()],
|
||||
build: {
|
||||
...SOURCE_MAP_OPTS,
|
||||
rollupOptions: {
|
||||
input: { index: resolve(__dirname, 'src/preload/index.ts') }
|
||||
}
|
||||
}
|
||||
},
|
||||
renderer: {
|
||||
root: 'src/renderer',
|
||||
build: {
|
||||
...SOURCE_MAP_OPTS,
|
||||
rollupOptions: {
|
||||
input: {
|
||||
index: resolve(__dirname, 'src/renderer/index.html'),
|
||||
'floating-pomodoro': resolve(__dirname, 'src/renderer/floating-pomodoro/index.html'),
|
||||
'floating-clock': resolve(__dirname, 'src/renderer/floating-clock/index.html'),
|
||||
'floating-alarms': resolve(__dirname, 'src/renderer/floating-alarms/index.html'),
|
||||
'floating-countdown': resolve(__dirname, 'src/renderer/floating-countdown/index.html')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user