Package Exports
- @nstudio/nativescript
- @nstudio/nativescript/index.js
- @nstudio/nativescript/src/utils
- @nstudio/nativescript/src/utils/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@nstudio/nativescript) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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
npx create-nx-workspace@latest
✔ 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.
npm install @nx/js -DNow initialize -- This will ensure a tsconfig.base.json is created to begin building your workspace.
npx nx g @nx/js:initInstall the tools:
npm install @nstudio/xplat -DYou are now ready to create apps:
npx nx g @nstudio/xplat:appPotential schematics error: If you encounter a SchematicNameCollisionException issue, you can see this gist to apply a patch: https://gist.github.com/NathanWalker/a8554c1e0bba700affeb0c4672d26b0e
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:
npx nx g @nstudio/xplat:app samplechoose
web
You can now use the web app as the Electron target:
npx nx g @nstudio/xplat:app desktop --target=web-samplechoose
electron
Develop with:
npm run start.electron.desktopIonic
npx nx g @nstudio/xplat:app samplechoose
ionic
Develop in browser with:
npx nx serve ionic-sampleBuild Ionic app:
npx nx build ionic-sampleA. Capacitor iOS - Prepare for development
npm run prepare.ionic.sample.iosYou can now open in Xcode for further development:
npm run open.ionic.sample.iosB. Capacitor Android - Prepare for development
npm run prepare.ionic.sample.androidYou can now open in Android Studio for further development:
npm run open.ionic.sample.androidNativeScript
nx g @nstudio/xplat:app mobilechoose
nativescript
A. iOS
npx nx run nativescript-mobile:iosB. Android
npx nx run nativescript-mobile:androidDocumentation
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
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