@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 15 and lower use @nrwl/ instead of @nx/

โฏ

nx run mobile:export

Examples

The bundler option allows you to bundle with either metro or webpack. The bundler you specified should be the same as the value web.bundle in your project's app.json.

Bundle using webpack:

1 "export": { 2 "executor": "@nx/expo:export", 3 "options": { 4 "platform": "all", 5 "bundler": "webpack" 6 }, 7 "dependsOn": ["sync-deps"] 8 }, 9
Nx 15 and lower use @nrwl/ instead of @nx/

or run command nx export mobile --bundler=webpack.

Bundle using metro:

1 "export": { 2 "executor": "@nx/expo:export", 3 "outputs": ["{options.outputDir}"], 4 "options": { 5 "platform": "all", 6 "bundler": "metro", 7 "outputDir": "dist/apps/dogs" 8 }, 9 "dependsOn": ["sync-deps"] 10 }, 11
Nx 15 and lower use @nrwl/ instead of @nx/

or run command nx export mobile --bundler=metro.

The exported files would be located under whatever you specified in outputDir.

Options

bundler

Required
string
Default: metro
Accepted values: metro, webpack

Choose the bundler to compile for

platform

p
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