refactor: minor changes
This commit is contained in:
parent
0edc38fc9d
commit
eb8b69966d
|
@ -30,7 +30,7 @@
|
||||||
},
|
},
|
||||||
"runtimeArgs": [
|
"runtimeArgs": [
|
||||||
"--remote-debugging-port=9229",
|
"--remote-debugging-port=9229",
|
||||||
"${workspaceRoot}/dist/main/index.cjs"
|
"${workspaceRoot}/dist/electron/main/index.cjs"
|
||||||
],
|
],
|
||||||
"envFile": "${workspaceFolder}/.vscode/.debug.env"
|
"envFile": "${workspaceFolder}/.vscode/.debug.env"
|
||||||
},
|
},
|
||||||
|
|
|
@ -15,9 +15,9 @@ if (!app.requestSingleInstanceLock()) {
|
||||||
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'
|
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'
|
||||||
|
|
||||||
let win: BrowserWindow | null = null
|
let win: BrowserWindow | null = null
|
||||||
// Here, you can also use other preload
|
// Here you can add more preload scripts
|
||||||
const splash = join(__dirname, '../preload/splash.js')
|
const splash = join(__dirname, '../preload/splash.js')
|
||||||
// 🚧 Use ['ENV_NAME'] avoid vite:define plugin
|
// 🚧 Use ['ENV_NAME'] to avoid vite:define plugin
|
||||||
const url = `http://${process.env['VITE_DEV_SERVER_HOST']}:${process.env['VITE_DEV_SERVER_PORT']}`
|
const url = `http://${process.env['VITE_DEV_SERVER_HOST']}:${process.env['VITE_DEV_SERVER_PORT']}`
|
||||||
|
|
||||||
async function createWindow() {
|
async function createWindow() {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
function domReady(condition: DocumentReadyState[] = ['complete', 'interactive']) {
|
function domReady(condition: DocumentReadyState[] = ['complete', 'interactive']) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
if (condition.includes(document.readyState)) {
|
if (condition.includes(document.readyState)) {
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
|
|
||||||
export { }
|
export { }
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
// Expose some Api through preload script
|
// Expose API through preload script
|
||||||
fs: typeof import('fs')
|
fs: typeof import('fs')
|
||||||
ipcRenderer: import('electron').IpcRenderer
|
ipcRenderer: import('electron').IpcRenderer
|
||||||
removeLoading: () => void
|
removeLoading: () => void
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
declare namespace NodeJS {
|
declare namespace NodeJS {
|
||||||
interface ProcessEnv {
|
interface ProcessEnv {
|
||||||
NODE_ENV: 'development' | 'production'
|
NODE_ENV: 'development' | 'production'
|
||||||
|
|
Loading…
Reference in New Issue