Skip to content

Commit

Permalink
perf: ♻️ Reduce build package size by removing redundant dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Dec 5, 2024
1 parent 9777622 commit 7b61b25
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 18 deletions.
24 changes: 6 additions & 18 deletions electron/configs/index.js
Original file line number Diff line number Diff line change
@@ -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
}
10 changes: 10 additions & 0 deletions electron/configs/logo/index.js
Original file line number Diff line number Diff line change
@@ -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
}
16 changes: 16 additions & 0 deletions electron/configs/tray/index.js
Original file line number Diff line number Diff line change
@@ -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()
Binary file added electron/resources/extra/win/tray/icon.ico
Binary file not shown.
Binary file added electron/resources/extra/win/tray/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7b61b25

Please sign in to comment.