refactor: minor changes

This commit is contained in:
Paul 2022-06-06 21:23:25 +03:00
parent 0edc38fc9d
commit eb8b69966d
5 changed files with 4 additions and 7 deletions

2
.vscode/launch.json vendored
View File

@ -30,7 +30,7 @@
},
"runtimeArgs": [
"--remote-debugging-port=9229",
"${workspaceRoot}/dist/main/index.cjs"
"${workspaceRoot}/dist/electron/main/index.cjs"
],
"envFile": "${workspaceFolder}/.vscode/.debug.env"
},

View File

@ -15,9 +15,9 @@ if (!app.requestSingleInstanceLock()) {
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'
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')
// 🚧 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']}`
async function createWindow() {

View File

@ -1,4 +1,3 @@
function domReady(condition: DocumentReadyState[] = ['complete', 'interactive']) {
return new Promise(resolve => {
if (condition.includes(document.readyState)) {

3
src/global.d.ts vendored
View File

@ -1,9 +1,8 @@
export { }
declare global {
interface Window {
// Expose some Api through preload script
// Expose API through preload script
fs: typeof import('fs')
ipcRenderer: import('electron').IpcRenderer
removeLoading: () => void

1
types.d.ts vendored
View File

@ -1,4 +1,3 @@
declare namespace NodeJS {
interface ProcessEnv {
NODE_ENV: 'development' | 'production'