[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"book:r2Xr2XOR":3,"book:recs:r2Xr2XOR":35},{"id":4,"created_at":5,"updated_at":5,"code":6,"author_id":7,"title":8,"slug":9,"cover_theme_key":10,"visibility":11,"status":12,"sort_order":4,"favorite_count":13,"view_count":4,"author":14,"chapter_count":7,"word_count":25,"free_count":13,"is_favorite":23,"book_status":12,"unparted":26},3,"2024-01-06T03:24:09.349+08:00","r2Xr2XOR",1,"Electron Forge","electron-forge-3","default","public","published",0,{"id":7,"created_at":15,"updated_at":16,"code":17,"username":18,"display_name":19,"role":20,"avatar_url":21,"is_active":22,"is_banned":23,"follower_count":13,"following_count":4,"last_login_at":24},"2023-11-30T23:53:12.952+08:00","2026-10-20T16:16:54.352+08:00","Mg87g8Gk","1701359592888","大苹果","verified_author","\u002Fcuts\u002F17021220625513129.png",true,false,"2026-10-20T16:12:35+08:00",3167,[27],{"id":28,"created_at":29,"updated_at":29,"code":30,"author_id":7,"book_id":4,"slug":31,"article_id":32,"title":33,"sort_order":28,"content":34,"status":12},15,"2024-01-06T03:24:27.301+08:00","QmXR46zj","开始学习-15",165,"开始学习","## 开始学习\n\n使用完整的构建管道快速构建 Electron 项目\n\n### 概述\n\nElectron Forge 是一款用于打包和分发 Electron 应用程序的一体化工具。它结合了许多单一用途的包来创建一个开箱即用的完整构建管道，包括代码签名、安装程序和工件发布。[对于高级工作流程，可以通过其Plugin API](http:\u002F\u002Fwww.okgoes.com\u002Fconfig\u002Fplugins)在 Forge 生命周期中添加自定义构建逻辑。[自定义构建和存储目标可以通过创建您自己的Makers](http:\u002F\u002Fwww.okgoes.com\u002Fconfig\u002Fmakers)和[Publishers](http:\u002F\u002Fwww.okgoes.com\u002Fconfig\u002Fpublishers)来处理。\n\n## 创建一个新应用程序\n\n要开始使用 Electron Forge，我们首先需要使用 `create-electron-app`. [该脚本是 Forge 的Init](http:\u002F\u002Fwww.okgoes.com\u002Fcli#Init)命令的便捷包装。\n\n> Electron Forge 目前仅支持 npm 和 Yarn Classic。如果您使用的 Yarn >=2，请使用 `nodeLinker: node-modules`安装模式。\n\n```bash\nnpm init electron-app@latest my-app\n```\n\n### 使用模板\n\nForge 的初始化脚本可以使用该标志添加额外的模板代码 `--template=[template-name]`。\n\n```bash\nnpm init electron-app@latest my-app -- --template=webpack\n```\n\n* `webpack`\n* `webpack-typescript`\n* `vite`\n* `vite-typescript`\n\n目前有四种第一方模板：\n\n这两个模板都是围绕插件构建的，这些插件捆绑了用于生产的 JavaScript 代码，并包含开发服务器以提供更好的开发人员体验。\n\n我们强烈建议您在初始化应用程序时使用这些模板，以利用现代前端 JavaScript 工具。\n\n要了解有关为 Electron Forge 创作自己的模板的更多信息，请查看[编写模板](http:\u002F\u002Fwww.okgoes.com\u002Fadvanced\u002Fextending-electron-forge\u002Fwriting-templates)指南！\n\n## 启动您的应用程序\n\n您现在应该有一个名为的目录，`my-app`其中包含基本 Electron 应用程序所需的所有文件。\n\n```bash\ncd my-app\nnpm start\n```\n\n## 构建可分发内容\n\n因此，您已经有了一个**令人惊叹的**应用程序，并且您希望将其全部打包并与全世界分享。如果您运行该 `make`脚本，Electron Forge 将为您生成特定于平台的可分发文件，供您与所有人共享。有关您可以制作哪种可分发文件的更多信息，请查看[创客](http:\u002F\u002Fwww.okgoes.com\u002Fconfig\u002Fmakers)文档。\n\n```bash\nnpm run make\n```\n\n## 发布您的应用程序\n\n现在您有了可以与用户共享的可分发文件。如果您运行该 `publish`脚本，Electron Forge 将使用您选择的发布方法为您发布特定于平台的可分发文件。有关我们当前支持的发布商的更多信息，请查看[发布商](http:\u002F\u002Fwww.okgoes.com\u002Fconfig\u002Fpublishers)文档。\n\n```bash\nnpm run publish\n```\n\n## 高级用法\n\n一旦您启动、构建和发布了基本的应用程序，就可以添加自定义配置了，这可以在文件中完成 `forge.config.js`。[配置选项在配置文档](https:\u002F\u002Fwww.electronforge.io\u002Fconfiguration)中指定。\n\n您还可以查看有关我们一些更高级功能的文档，例如：\n\n* 添加插件\n* 调试你的应用程序\n* 编写自己的制作这、发布这和插件\n",[36,42,49],{"id":7,"created_at":37,"updated_at":37,"code":17,"author_id":7,"title":38,"slug":39,"cover_theme_key":10,"visibility":11,"status":12,"sort_order":7,"favorite_count":13,"view_count":40,"author":41},"2023-12-27T13:08:44.239+08:00","ElasticSearch","elasticsearch-1",6,{"id":7,"created_at":15,"updated_at":16,"code":17,"username":18,"display_name":19,"role":20,"avatar_url":21,"is_active":22,"is_banned":23,"follower_count":13,"following_count":4,"last_login_at":24},{"id":43,"created_at":44,"updated_at":44,"code":45,"author_id":7,"title":46,"slug":47,"cover_theme_key":10,"visibility":11,"status":12,"sort_order":43,"favorite_count":13,"view_count":4,"author":48},2,"2023-12-30T11:23:15.697+08:00","yj6y7X92","分布式事务Seata","分布式事务seata-2",{"id":7,"created_at":15,"updated_at":16,"code":17,"username":18,"display_name":19,"role":20,"avatar_url":21,"is_active":22,"is_banned":23,"follower_count":13,"following_count":4,"last_login_at":24},{"id":50,"created_at":51,"updated_at":52,"code":53,"author_id":7,"title":54,"slug":55,"cover_theme_key":10,"visibility":11,"status":12,"sort_order":50,"favorite_count":13,"view_count":43,"author":56},4,"2024-01-06T03:31:06.026+08:00","2024-01-08T15:22:03.316+08:00","zJXMbKwb","企业微信开发","企业微信开发-4",{"id":7,"created_at":15,"updated_at":16,"code":17,"username":18,"display_name":19,"role":20,"avatar_url":21,"is_active":22,"is_banned":23,"follower_count":13,"following_count":4,"last_login_at":24}]