//๋๋ ํ ๋ฆฌ์ ์์ด์ฝ ํ์ผ์ ๋ฃ์ ๋ค ์ค์
//electron.js - ๋ฉ์ธํ๋ก์ธ์ ํ์ผ
const {app, BrowserWindow,ipcMain} = require('electron')
const path = require('path')
// const fs = require("fs");
function createWindow () {
const mainWindow = new BrowserWindow({
width: 528,
height: 791,
resizable:false, //size ๊ณ ์
useContentSize :true, //๊ฐ์ด๋ฐ ์ค์
center:true, //์ฑ ์คํ์ ์๋์ฐ๋ฅผ ํ๋ฉด ์ ์ค์์ ์์น
**icon:path.join(__dirname,'[๋ก๊ณ path]'), //์ผ๋ ํธ๋ก ์ฑ ๋ก๊ณ ๋ณ๊ฒฝ**
//ELECTRON ์น ํ๊ฒฝ์ค์
webPreferences: {
preload: path.join(__dirname, 'preload.js'), //์ ๋๊ฒฝ๋ก
webSecurity: false, //CORS ์๋ฌ ๋ฐฉ์ง
// TypeError: window.require is not a function ์ผ๋ ์ถ๊ฐ\\
nodeIntegration: false,
enableRemoteModule: false,
contextIsolation: true, //preload.js์์ ContextBridge๋ฅผ ์ฌ์ฉํ๊ธฐ ์ํจ
showMessageBox:true,
}
})
}
Reference
https://inote.gitlab.io/2017/Electron%20App%20Icon%20%EB%B3%80%EA%B2%BD%ED%95%98%EA%B8%B0/
'Development > Electron' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Electron] ipcRenderer.invoke & ipcMin.handle (0) | 2023.06.15 |
---|---|
[Electron] dialog.showOpenDialog() (0) | 2023.06.15 |
[Electron] Electron + React ์ฐ๋ํ๊ธฐ (0) | 2023.01.13 |
[Electron]Electron-forge (0) | 2023.01.12 |
[Electron]Electron (0) | 2023.01.11 |
๋๊ธ