Merge pull request #70 from electron-vite/v2.1.0

v2.1.0: use `vite-electron-plugin` instead `vite-plugin-electron`
This commit is contained in:
草鞋没号 authored and GitHub committed 2022-10-04 07:18:22 +08:00
commit 5e839b2f6d
9 files changed
+63 -70

No files matched your search

+3 -16
View File
@@ -1,22 +1,9 @@
/// <reference types="vite-plugin-electron/electron-env" />
/// <reference types="vite-electron-plugin/electron-env" />
declare namespace NodeJS {
interface ProcessEnv {
/**
* The built directory structure
*
* ```tree
* ├─┬ dist
* │ ├─┬ electron
* │ │ ├─┬ main
* │ │ │ └── index.js
* │ │ └─┬ preload
* │ │ └── index.js
* │ ├── index.html
* │ ├── ...other-static-files-from-public
* │
* ```
*/
VSCODE_DEBUG?: 'true'
DIST_ELECTRON: string
DIST: string
/** /dist/ or /public/ */
PUBLIC: string
+10 -11
View File
@@ -1,17 +1,16 @@
// The built directory structure
//
// ├─┬ dist-electron
// │ ├─┬ main
// │ │ └── index.js > Electron-Main
// │ └─┬ preload
// │ └── index.js > Preload-Scripts
// ├─┬ dist
// │ ├─┬ electron
// │ │ ├─┬ main
// │ │ │ └── index.js
// │ │ └─┬ preload
// │ │ └── index.js
// │ ├── index.html
// │ ├── ...other-static-files-from-public
// │
process.env.DIST = join(__dirname, '../..')
process.env.PUBLIC = app.isPackaged ? process.env.DIST : join(process.env.DIST, '../public')
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'
// │ └── index.html > Electron-Renderer
//
process.env.DIST_ELECTRON = join(__dirname, '..')
process.env.DIST = join(process.env.DIST_ELECTRON, '../dist')
process.env.PUBLIC = app.isPackaged ? process.env.DIST : join(process.env.DIST_ELECTRON, '../public')
import { app, BrowserWindow, shell, ipcMain } from 'electron'
import { release } from 'os'