본문 바로가기
반응형

개발/Electron3

일렉트론 - Menu 모듈로 메뉴 만들기 (Create Native Application Menus and Context Menus) Electron 전체 링크 참고 - https://www.electronjs.org/docs/latest/api/menu electron.js를 아래와 같이 수정한다. const { app, BrowserWindow, Menu } = require("electron"); // Menu 추가 const path = require("path"); const isDev = require("electron-is-dev"); function createWindow() { const win = new BrowserWindow({ width: 800, height: 600, webPreferences: { nodeIntegration: true, }, }); win.loadURL( isDev ? "http://loc.. 2024. 1. 3.
일렉트론 - 리액트 프로젝트 빌드하기 (Build Electron App with React) Electron 전체 링크 참고 - Hash Router로 gh-pages 배포하기 리액트 프로젝트를 먼저 생성하자. yarn create react-app react-with-electron 설치가 완료되었다면, 생성한 프로젝트로 이동하자. cd react-with-electron 이제 electron을 설치한다. npm install electron 앱 개발 환경을 구분하기 위한 패키지 electron-is-dev를 설치한다. npm install electron-is-dev 여러 명령어를 병렬 실행하기 위해 concurrently를 설치한다. (리액트 + 일렉트론 실행) npm install concurrently 특정 조건을 만족할 때까지 기다리기 위해 wait-on을 설치한다. (리액트 실행 후.. 2024. 1. 2.
일렉트론 설치하기 (Download Electron) Electron 전체 링크 Node를 설치하면 일렉트론을 설치할 수 있다. 여기서 사용하는 Node 버전은 다음과 같다. $ node -v v16.19.0 electron_app 폴더를 만들고, 해당 폴더에서 npm init을 실행한다. entry point가 electron app의 main이 된다. 여기서는 기본으로 설정된 index.js로 하였다. $ npm init This utility will walk you through creating a package.json fi It only covers the most common items, and tries to guess sens See `npm help init` for definitive documentation on these fie an.. 2023. 12. 31.
반응형