百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

nx-electron

> 数据库
开源

nrwl nx 平台电子原理图

371 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

nrwl nx 平台电子原理图

Features

Nx Electron provides a set of power ups on Nx for developing cross platform desktop apps using Electron.

  • Schematics: Provides schematics for developing cross platform apps in a mono repo environment.
  • Typescript: Uses Typescript to help reduce errors, and create more structured code.
  • Obfuscation: Since Electron are used on the client machines, nx-electron obfuscates you code (and only it).
  • Minimization: Electron apps tend to be quite large, hence we use webpack to bundle, and minimize to code.
  • Live Update: Provides continuous live reload for your backend code.
  • Event Templates: Provides templates for common events like squirrel setup events, auto update events and IPC events.
  • Packaging: Packages your frontend and backend webpack bundles into an electron package.
  • Making: Makes your frontend and backend webpack bundles into single standalone executable.

Compatibility

[!IMPORTANT] This repository follows the semantic versioning rules while adhering to both Nx and Angular versioning scheme. Make sure that Nx Electron major version match Nx major version. I.e. version 21.x of Nx Electron will be compatible with version 21.y of Nx.

Getting Started

Prerequisite

This module is based on Nx, you will need to set up an Nx workspace before you can use Nx Electron.

bash
npx create-nx-workspace@21

Installation

bash
npm install -D nx-electron

Creating Nx Electron Application

bash
nx g nx-electron:app  --frontendProject=

[!IMPORTANT] Make sure to select Integrated monorepo as a project style, and Webpack as a bundler.

[!NOTE] You should add a frontend project to you workspace prior to invoking this command.

[!TIP] On certain frontend platforms (such as Angular, React, etc...) it is important to:

  1. change the baseHref field to "./".
  2. Use router outlet hash strategy. Further details can be found here.

[!NOTE] Nx Electron application usually contain both frontend and backend. When you wish to build, serve, test, etc. your application, make sure to invoke the command for both the frontend and the backend. Most of the the time, side-by-side terminal windows are more convenient.

Building Nx Electron Application

  • Frontend: Run nxe:build:frontend or nx build to build your frontend application.
  • Backend: Run nxe:build:backend or nx build to build your backend application.

Serving Nx Electron Application

  • Frontend: Run nxe:serve:frontend or nx serve to serve your frontend application.
  • Backend: Run nxe:serve:backend or nx serve to serve your backend application.

Testing Nx Electron Application

  • Frontend: Run nxe:test:frontend or nx test to test your frontend application.
  • Backend: Run nxe:test:backend or nx test to test your backend application.

Packaging Nx Electron Application

  • Run nxe:package:app or nx run :package [--options] to package your application.

    The options that can be passed are described here.

    ✦︎ Important

    Make sure to build both the frontend project and the backend project before packaging your application.

Making Nx Electron Application (standalone build)

  • Run nxe:make:app or nx run :make [--options] to make your standalone application.

    The options that can be passed are described here.

    ✦︎ Important

    Make sure to build both the frontend project and the backend project before making your standalone application.

Configuring static packaging / making options

It is possible to configure all the packaging / making options in .\apps\\src\app\options\maker.options.json. For more information read this article.

[!IMPORTANT] Option you define at this file will override the options you pass manually via the command line or choose via the angular console.

Migrating Nx Electron Application

To migrate automatically run ng update nx-electron@. You can find detailed information in the following migration guides.

Debugging Nx Electron Application

  • Follow this instructions in order to configure the debugger your IDE.

Minimal Project Structure

Regardless of what framework you chose, the resulting file tree will look like this:

treeview
/
├── apps/
│   ├── electron-app-name/
│   ├── frontend-app-name/
│   └── frontend-app-name-e2e/
├── libs/
├── tools/
├── nx.json
├── package.json
├── tsconfig.json
└── tslint.json

Support

If you're having any problem, please raise an issue on GitHub and we'll be happy to help.

Contribute

  • Follow this instructions in order to learn how to contribute to this project.

Attribution

This project is highly inspired by (and dependent on) Nrwl Nx platform. Under the hood, we use Electron Builder to package and make electron application executables.

Author: Benny Megidish.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptcross-platformelectronmonorepongx

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库