packages/expo/docs/export-examples.md
project.json:
{
"name": "mobile",
//...
"targets": {
//...
"export": {
"executor": "@nx/expo:export",
"options": {
"outputs": ["{options.outputDir}"],
"platform": "all",
"outputDir": "dist/apps/mobile"
},
"dependsOn": ["sync-deps"]
}
//...
}
}
nx run mobile:export
The outputDir option allows you to specify the output directory of your bundle:
"export": {
"executor": "@nx/expo:export",
"outputs": ["{options.outputDir}"],
"options": {
"platform": "all",
"bundler": "metro",
"outputDir": "dist/apps/mobile"
},
"dependsOn": ["sync-deps"]
},
or run command: nx run mobile:export --outputDir=dist/apps/mobile.
The platform option allows you to specify the platform to compile with metro bundler: "ios", "android", "all", and "web".
For example, to bundle for web:
"export": {
"executor": "@nx/expo:export",
"outputs": ["{options.outputDir}"],
"options": {
"platform": "web",
"bundler": "metro",
"outputDir": "dist/apps/dogs"
},
"dependsOn": ["sync-deps"]
},
or run command nx export mobile --platform=web.
The dev option allows you to bundle for development environments.
"export": {
"executor": "@nx/expo:export",
"outputs": ["{options.outputDir}"],
"options": {
"platform": "web",
"bundler": "metro",
"outputDir": "dist/apps/dogs",
"dev": true
},
"dependsOn": ["sync-deps"]
},
or run command nx export mobile --dev.
The clear option allows you to clear bundle cache.
"export": {
"executor": "@nx/expo:export",
"outputs": ["{options.outputDir}"],
"options": {
"platform": "web",
"bundler": "metro",
"outputDir": "dist/apps/dogs",
"clear": true
},
"dependsOn": ["sync-deps"]
},
or run command nx export mobile --clear.