Electron - 배포

Posted by Seongkyun Yu on 2021-03-20
Estimated Reading Time 1 Minutes
Words 126 In Total
Viewed Times

Electron Logo

12.0.6 버전을 기준으로 한 설명입니다

electron-builder

Electron은 여러가지 Builder가 있지만 여기선 electron-builder를 사용하겠다.

먼저 패키지를 설치한다.

npm install -D electron-builder

package.json

package.json에 다음과 같은 설정을 추가한다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"build": {
"productName": "Electron",
"asar": true,
"mac": {
"target": [
"default"
],
"icon": "./src/main/assets/icons/icon.icns"
},
"dmg": {
"title": "Electron",
"icon": "./src/main/assets/icons/icon.icns"
},
"win": {
"target": "nsis",
"icon": "./src/main/assets/icons/icon.ico"
},
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": true
},
"files": [
"src/**/*"
]
},

"scripts": {
"start": "electron .",
"build": "webpack --config webpack.config.js",
"build-mac": "electron-builder --mac",
"build-win32": "electron-builder --win --ia32",
"build-win64": "electron-builder --win --x64",
},

각 OS별 아이콘 타입 등을 설정하고 script를 작성한다.


If you like this blog or find it useful for you, you are welcome to comment on it. You are also welcome to share this blog, so that more people can participate in it. If the images used in the blog infringe your copyright, please contact the author to delete them. Thank you !