perf: ♻️ Reduce build package size by removing redundant dependencies

This commit is contained in:
viarotel 2024-12-05 10:03:01 +08:00
parent 9777622830
commit 7b61b25f4e
7 changed files with 32 additions and 18 deletions

View File

@ -1,29 +1,17 @@
import { resolve } from 'node:path'
import { buildResolve, extraResolve } from '$electron/helpers/index.js'
export * from './android-platform-tools/index.js'
export { adbPath } from './android-platform-tools/index.js'
export * from './gnirehtet/index.js'
export { gnirehtetApkPath, gnirehtetPath } from './gnirehtet/index.js'
export * from './logo/index.js'
export { scrcpyPath } from './scrcpy/index.js'
export * from './scrcpy/index.js'
export * from './tray/index.js'
export const desktopPath = process.env.DESKTOP_PATH
export const devPublishPath = resolve('dev-publish.yml')
export const logoPath = buildResolve('logo.png')
export const icoLogoPath = buildResolve('logo.ico')
export const icnsLogoPath = buildResolve('logo.icns')
export const trayPath
= process.platform === 'darwin'
? extraResolve('mac/tray/iconTemplate.png')
: extraResolve('common/tray/icon.png')
export const logPath = process.env.LOG_PATH
export function getLogoPath() {
const icon = logoPath
return icon
}

View File

@ -0,0 +1,10 @@
import { buildResolve } from '$electron/helpers/index.js'
export const logoPath = buildResolve('logo.png')
export const icoLogoPath = buildResolve('logo.ico')
export const icnsLogoPath = buildResolve('logo.icns')
export function getLogoPath() {
const icon = logoPath
return icon
}

View File

@ -0,0 +1,16 @@
import { extraResolve } from '$electron/helpers/index.js'
export function getTrayPath() {
switch (process.platform) {
case 'win32':
return extraResolve('win/tray/icon.png')
case 'darwin':
return extraResolve('mac/tray/iconTemplate.png')
case 'linux':
return extraResolve('linux/tray/icon.png')
default:
return ''
}
}
export const trayPath = getTrayPath()

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB