Skip to content

Commit

Permalink
Refactor to centralize Electron entry file path
Browse files Browse the repository at this point in the history
This commit centralizes directory settings and eliminates duplication.

- Replace hardcoded path in `package.json`s `main field` with the new
  `ELECTRON_ENTRY` environment variable from `electron-vite`.
- Update `electron-vite` to v1.0.28 to utilize this environment variable
  feature (see electron-vite/issues$270 for more details).
  • Loading branch information
undergroundwires committed Oct 22, 2023
1 parent 060e789 commit 5fe4002
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 2 additions & 0 deletions electron.vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const PRELOAD_ENTRY_FILE = resolvePathFromProjectRoot('src/presentation/electron
const WEB_INDEX_HTML_PATH = resolvePathFromProjectRoot('src/presentation/index.html');
const DIST_DIR = resolvePathFromProjectRoot(distDirs.electronUnbundled);

process.env.ELECTRON_ENTRY = resolve(DIST_DIR, 'main/index.cjs');

export default defineConfig({
main: getSharedElectronConfig({
distDirSubfolder: 'main',
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"description": "Enforce privacy & security best-practices on Windows, macOS and Linux, because privacy is sexy 🍑🍆",
"author": "undergroundwires",
"type": "module",
"main": "./dist-electron-unbundled/main/index.cjs",
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
Expand Down Expand Up @@ -63,7 +62,7 @@
"electron-builder": "^24.6.4",
"electron-devtools-installer": "^3.2.0",
"electron-icon-builder": "^2.0.1",
"electron-vite": "^1.0.27",
"electron-vite": "^1.0.28",
"eslint": "^8.51.0",
"eslint-plugin-cypress": "^2.15.1",
"eslint-plugin-vue": "^9.17.0",
Expand Down

0 comments on commit 5fe4002

Please sign in to comment.