一个基于 create-react-app 和 typescript 的 electron 模板
一个基于 create-react-app 和 typescript 的 electron 模板
如果项目内部使用 antd 可以直接克隆 带有 and 的模板。
# Clone this repository
git clone https://github.com/Col0ring/ts-react-electron-template.git
# Go into the repository
cd ts-react-electron-template
# Install dependencies
npm install
# or
yarn
开发环境:
./main/index.ts
,如果要修改可以在package.json
中进行修改。create-react-app
开发。
npm run start
# or
yarn start
生产环境:
npm run build
# or
yarn build
也可以直接使用程序打包的命令进行打包,像下面直接打包成当前平台的可执行程序:
npm run pack
# or
# yarn 也需要带上 run,不然会触发 yarn 的 pack 命令
yarn run pack
注意: 由于electron-builder
会将dependencies
的依赖都打包进去,所以为了减小打包体积,尽量将依赖都放到devDependencies
中。
👤 Col0ring
Give a ⭐️ if this project helped you!