1 Star 5 Fork 0

一九 / electron打包项目模板

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

鸣谢

本模板是在 白云苍狗壁纸APP 上提炼了一个开发框架 原项目地址:https://gitee.com/ml13/wallhaven-electron

仅仅提供给electron小白新手,大神勿喷。

前期准备

环境说明

建议全局安装electronelectron-builder

npm install -g electron
npm install -g electron-builder

如果安装失败,请在管理员命令行运行再试,如果安装过慢,切换安装源

安装electron常见问题

安装慢切换镜像源

  1. 打开设置
npm config edit

通过以上命令打开.npmrc文件

  1. 在文件最后追加
ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/
ELECTRON_BUILDER_BINARIES_MIRROR=https://npm.taobao.org/mirrors/electron-builder-binaries/

如果安装过程中有类似以下提示

npm ERR! code EPERM
npm ERR! syscall rename

那么需要以管理员模式运行命令安装。

配置说明

LOGO 修改

  1. \build目录下ico文件

  2. \src\main\icon\目录下logo.png文件

名称修改

\package.json中修改

资源目录

\src\renderer为 html 资源目录 确保该资源能通过file协议访问

个性配置

如果要全屏、或者其他的特殊需求,可在/src/index.js文件中修改。 具体参数请移步查阅:https://www.electronjs.org/docs/api/browser-window

运行

调试运行

npm run dev

打包

npm run build
MIT License Copyright (c) 2021 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

electron打包项目模板,直接将文件复制进来打包即可 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/onenine-top/electron-exe.git
git@gitee.com:onenine-top/electron-exe.git
onenine-top
electron-exe
electron打包项目模板
master

搜索帮助