使用 React 和 TypeScript 开发 electron 应用,支持多特性
erb.config.js
windows electron BrowserWindowselectron/set-touchbar.ts
electron/set-tray.ts
electron/set-dock-menu
package.json
build
git clone --depth=1 https://github.com/fantasticit/electron-react-boilerplate.git your-project-name
cd your-project-name
npm install
, renderer
(,: hot-module-replacement) electron
.
npm run dev
: 8080
,,:
npm run dev other-port // such as npm run dev 9090
Jest
:
npm test
jest.config.js
.
:
npm run build
package.json
,:
"build": {
"mac": {
"icon": "icons/icon.icns"
},
"win": {
"icon": "icons/icon.ico"
},
"linux": {
"icon": "icons"
}
}
index.html
, App .
MIT