Boilerplates and CLIs样板和CLI
Electron development is unopinionated - there is no "one true way" to develop, build, package, or release an Electron application. Electron开发是非关联的-开发、构建、打包或发布Electron应用程序没有“一种真正的方法”。Additional features for Electron, both for build- and run-time, can usually be found on npm in individual packages, allowing developers to build both the app and build pipeline they need.Electron的其他功能,包括构建和运行时功能,通常可以在npm的单个包中找到,允许开发人员构建他们需要的应用程序和构建管道。
That level of modularity and extendability ensures that all developers working with Electron, both big and small in team-size, are never restricted in what they can or cannot do at any time during their development lifecycle. 这种模块化和可扩展性水平确保了所有与Electron合作的开发人员,无论团队规模大小,在开发生命周期的任何时候都不会受到限制。However, for many developers, one of the community-driven boilerplates or command line tools might make it dramatically easier to compile, package, and release an app.然而,对于许多开发人员来说,社区驱动的样板或命令行工具可能会使编译、打包和发布应用程序变得非常容易。
Boilerplate vs CLI样板与CLI的对比
A boilerplate is only a starting point - a canvas, so to speak - from which you build your application. 样板只是一个起点,可以说是一个画布,您可以从中构建应用程序。They usually come in the form of a repository you can clone and customize to your heart's content.它们通常以存储库的形式出现,您可以根据自己的内心内容进行克隆和定制。
A command line tool on the other hand continues to support you throughout the development and release. 另一方面,命令行工具在整个开发和发布过程中继续支持您。They are more helpful and supportive but enforce guidelines on how your code should be structured and built. 它们更有帮助和支持性,但强制执行关于如何构建代码的指导原则。Especially for beginners, using a command line tool is likely to be helpful特别是对于初学者,使用命令行工具可能会有帮助.
electron-forge
A "complete tool for building modern Electron applications". “构建现代Electron应用的完整工具”。Electron Forge unifies the existing (and well maintained) build tools for Electron development into a cohesive package so that anyone can jump right in to Electron development.Electron Forge将现有的(维护良好的)用于Electron开发的构建工具统一到一个有凝聚力的包中,这样任何人都可以直接进入Electron开发。
Forge comes with a ready-to-use template using Webpack as a bundler. Forge提供了一个现成的模板,使用Webpack作为绑定器。It includes an example typescript configuration and provides two configuration files to enable easy customization. 它包括一个示例typescript配置,并提供两个配置文件以实现轻松的自定义。It uses the same core modules used by the greater Electron community (like electron-packager) – changes made by Electron maintainers (like Slack) benefit Forge's users, too.它使用了更大的Electron社区(如electron-packager)使用的相同核心模块-Electron维护者(如Slack)所做的更改也有利于Forge的用户。
You can find more information and documentation on electronforge.io.您可以找到有关electronforge.io的更多信息和文档。
electron-builder
A "complete solution to package and build a ready-for-distribution Electron app" that focuses on an integrated experience. 这是一个“打包和构建可供发布的Electron应用程序的完整解决方案”,专注于集成体验。electron-builder adds one single dependency focused on simplicity and manages all further requirements internally.electron-builder添加了一个单一的依赖项,专注于简单性,并在内部管理所有进一步的需求。
electron-builder
replaces features and modules used by the Electron maintainers (such as the auto-updater) with custom ones. 将Electron维护人员(如自动更新程序)使用的功能和模块替换为自定义功能和模块。They are generally tighter integrated but will have less in common with popular Electron apps like Atom, Visual Studio Code, or Slack.它们通常更紧密地集成,但与流行的Electron应用程序(如Atom、Visual Studio Code或Slack)的共同点较少。
You can find more information and documentation in the repository.您可以在存储库中找到更多信息和文档。
electron-react-boilerplate
If you don't want any tools but only a solid boilerplate to build from, CT Lin's electron-react-boilerplate might be worth a look. 如果您不需要任何工具,只需要一个坚实的样板来构建,CT Lin的electron-react-boilerplate可能值得一看。It's quite popular in the community and uses 它在社区中非常流行,并在内部使用electron-builder
internally.electron-builder
。
Other Tools and Boilerplates其他工具和样板
The "Awesome Electron" list contains more tools and boilerplates to choose from. “Awesome Electron”列表包含更多工具和样板文件可供选择。If you find the length of the list intimidating, don't forget that adding tools as you go along is a valid approach, too.如果您发现列表的长度令人生畏,请不要忘记,在执行过程中添加工具也是一种有效的方法。