WEB/Electron

· WEB/Electron
[Electron] VSCode에서 디버깅하는 방법 .vscode/launch.json 파일을 다음과 같이 생성한다. { "version": "0.2.0", "configurations": [ { "name": "Debug Main Process", "type": "node", "request": "launch", "cwd": "${workspaceRoot}", "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron", "windows": { "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd" }, "args" : ["."], "outputCapture": "std" ..
· WEB/Electron
[Electron] window.require is not a function 에러 예제) window.require('electron').ipcRenderer 추가하기. 1. 페이지의 다른 스크립트들이 실행되기 전 먼저 로드할 스크립트 추가. 파일명 : preload.js window.ipcRenderer = require('electron').ipcRenderer; 2. 메인 main.js (index.js) 파일에서 BrowserWindow 생성시 webPreferences 옵션 추가. new BrowserWindow({ ... webPreferences: { nodeIntegration: false, preload: __dirname + '/preload.js' } ... }); 3. 사용. wi..
· WEB/Electron
[Electron] electron 버전 업그레이드 2018년에 설치 했을 때 버전이 1.X 버전이었는데, 어느새 5.0.0 버전이 나왔다. electron 4.X 버전 부터인가 node 10버전 이상 이용하기 때문에 ES6를 babel을 사용하지 않고도 대부분의 명령어를 사용할 수 있다고 한다. * 여기서 릴리즈 버전을 확인할 수 있다. electron 최신 버전으로 업그레이드 명령어는 다음과 같다. 설치하는데 시간이 좀 걸린다. $ npm install electron@latest -g C:\WINDOWS\system32>npm install electron@latest -g C:\Users\itinerant\AppData\Roaming\npm\electron -> C:\Users\itinerant\..
· WEB/Electron
[Electron] 빌드(build) 하기 다음 글 : [Electron] 빌드(build) 하기 2 ( electron-builder ) 만든 Electron 어플리케이션을 빌드(Build)하는 방법이다. electron-package, electron-winstaller 등 사용(테스트)해봤는데, electron-builder가 가장 깔끔하고 간편한 것 같아 ( 가장 한글 문서가 많기도 했다. ) electron-builder 사용 법에 대해 간략히 설명하고자 한다. 1. electron-builder 기능 - NPM 패키지 관리 - 어플리케이션이 패키징되면 자동 업데이트함. ( 버전 관리 됨 ) - 다양한 타겟으로 포멧팅이 가능함. 설치 $ npm install -g electron-builder ..
· WEB/Electron
[Electron] build 시 unresolved modules 오류 해결 방법 Electron Build 할 때 아래와 같이 jQuery, popper 등 오류날 경우 > build Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead. Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead. • electron-builder version=20.3..
· WEB/Electron
[Electron] img 태그 src="file://~" 경로에 존재하는 파일이 로드되지 않는 경우 해결 방법 1. 오류 WebRoot 경로 및 하위 폴더에 존재하는 이미지는 상대 경로로 입력하여 이미지를 불러올 수 있지만, 로컬에 존재하는 파일 또는 다른 서버에 존재하는 파일을 로드할 경우, 절대 경로로 입력해 주어야 한다. C:/나 D:/ 등 마운트된 디렉토리는 정상적으로 접근해서 이미지를 로드했지만, 외부(다른) 서버에 존재하는 파일을 파일은 존재한다고 출력은 되나, 이미지를 불러오지 못했다. 아래 코드를 실행해 보면 image1은 이미지가 보이지만, image2는 이미지가 보이지 않았다. const fs = require("fs"); var image1 = document.createElemen..
S0PH1A
'WEB/Electron' 카테고리의 글 목록 (2 Page)