UNPKG

@nx/expo

Version:

The Expo Plugin for Nx contains executors and generators for managing and developing an expo application within your workspace. For example, you can directly build for different target platforms as well as generate projects and publish your code.

26 lines (25 loc) 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = update; const devkit_1 = require("@nx/devkit"); /** * Remove the offset from the outputDir of the export target */ async function update(tree) { const projects = (0, devkit_1.getProjects)(tree); for (const [projectName, config] of projects.entries()) { if (config.targets?.['export']?.executor === '@nx/expo:export') { const target = config.targets['export']; if (target.options?.outputDir) { const offset = (0, devkit_1.offsetFromRoot)(config.root); target.options.outputDir = target.options.outputDir.replace(offset, ''); target.outputs = ['{options.outputDir}']; (0, devkit_1.updateProjectConfiguration)(tree, projectName, config); } } if (config.targets?.['export-web']?.executor === '@nx/expo:export') { delete config.targets['export-web']; (0, devkit_1.updateProjectConfiguration)(tree, projectName, config); } } }