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

xplat

> 前端框架
开源

适用于 Nx 工作区的跨平台 (xplat) 工具。

374 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

适用于 Nx 工作区的跨平台 (xplat) 工具。

Cross-platform (xplat) tools for Nx workspaces

xplat is an added value pack for Nx which provides additional app generators and optional supporting architecture for different platform/framework combinations.

Currently supported platforms

  • Electron

    Build cross platform desktop apps with JavaScript, HTML, and CSS.

  • Ionic

    Build amazing apps in one codebase, for any platform, with the web.

  • NativeScript

    Build rich iOS and Android apps with direct access to native api's from JavaScript directly.

Quickstart

Note: Nx 19.x.x compatible.

bash
npx create-nx-workspace@19

✔ Where would you like to create your workspace? · {your-workspace-name}

# Choose "None"

? Which stack do you want to use? … 
None:          Configures a minimal structure without specific frameworks or technologies.

# Choose "Integrated"

? Package-based or integrated? … 
Integrated:    Nx creates a workspace structure most suitable for building apps.

Init workspace

Install the @nx/js plugin.

bash
npm install @nx/js -D

Now initialize -- This will ensure a tsconfig.base.json is created to begin building your workspace.

bash
npx nx g @nx/js:init

Install the tools:

bash
npm install @nstudio/xplat -D

You are now ready to create apps:

bash
npx nx g @nstudio/xplat:app

App generation examples

The additional app generators can be used as follows:

Electron

Electron app generator can use any web app in the workspace as it's target.

If you don't have a web app yet, create one first:

bash
npx nx g @nstudio/xplat:app sample

choose web

You can now use the web app as the Electron target:

bash
npx nx g @nstudio/xplat:app desktop --target=web-sample

choose electron

Develop with:

bash
npm run start.electron.desktop

Ionic

bash
npx nx g @nstudio/xplat:app sample

choose ionic

Develop in browser with:

bash
npx nx serve ionic-sample

Build Ionic app:

bash
npx nx build ionic-sample

A. Capacitor iOS - Prepare for development

bash
npm run prepare.ionic.sample.ios

You can now open in Xcode for further development:

bash
npm run open.ionic.sample.ios

B. Capacitor Android - Prepare for development

bash
npm run prepare.ionic.sample.android

You can now open in Android Studio for further development:

bash
npm run open.ionic.sample.android

NativeScript

nx g @nstudio/xplat:app mobile

choose nativescript

A. iOS

bash
npx nx run nativescript-mobile:ios

B. Android

bash
npx nx run nativescript-mobile:android

Talks

  • Super Powered, Server Rendered Progressive Native Apps by Nathan Walker and Jeff Whelpley
  • ngAir 172 - xplat (cross-platform) tools for Nx workspaces with Nathan Walker

Recommended extra tooling

  • VS Code
  • Nx Console for VS Code

Example repos for different scenarios

  • Ionic + Web: https://github.com/nstudio/xplat-sample-ionic-web
  • Electron + Web with routing: https://github.com/nstudio/xplat-sample-electron-routing

Context

  • Why it's Hard to Decide on Technologies by Adam Klein

Issues· 0 开放

查看全部 Issues在 GitHub 打开

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

> 标签

TypeScriptangularcross-platformelectronionic

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

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架