@nx/expo:export

Export the JavaScript and assets for your app using Metro/webpack bundler.

Options can be configured in project.json when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/reference/project-configuration#targets.

project.json:

1{ 2 "name": "mobile", 3 //... 4 "targets": { 5 //... 6 "export": { 7 "executor": "@nx/expo:export", 8 "options": { 9 "outputs": ["{options.outputDir}"], 10 "platform": "all", 11 "outputDir": "dist/apps/mobile" 12 }, 13 "dependsOn": ["sync-deps"] 14 } 15 //... 16 } 17} 18

โฏ

nx run mobile:export

Examples

The outputDir option allows you to specify the output directory of your bundle:

1 "export": { 2 "executor": "@nx/expo:export", 3 "outputs": ["{options.outputDir}"], 4 "options": { 5 "platform": "all", 6 "bundler": "metro", 7 "outputDir": "dist/apps/mobile" 8 }, 9 "dependsOn": ["sync-deps"] 10 }, 11

or run command: nx run mobile:export --outputDir=dist/apps/mobile.

Options

platform

pRequired
string
Default: all
Accepted values: ios, android, all, web

Choose the platform to compile for

clear

boolean

Clear the bundler cache before exporting

dev

boolean

Configure static files for developing locally using a non-https server

dumpAssetmap

boolean

When bundler is metro, whether to dump the asset map for further processing

minify

boolean

Minify source

maxWorkers

number

When bundler is metro, the maximum number of tasks to allow the bundler to spawn

outputDir

string

Relative to workspace root, the directory to export the static files to. Default: dist

sourceMaps

boolean

When bundler is metro, whether to emit JavaScript source maps