UNPKG

@nrwl/workspace

Version:

The Workspace plugin contains executors and generators that are useful for any Nx workspace. It should be present in every Nx workspace and other plugins build on it.

17 lines 935 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createProjectConfigurationInNewDestination = void 0; const devkit_1 = require("@nrwl/devkit"); function createProjectConfigurationInNewDestination(tree, schema, projectConfig) { if (projectConfig.name) { projectConfig.name = schema.newProjectName; } // replace old root path with new one const projectString = JSON.stringify(projectConfig); const newProjectString = projectString.replace(new RegExp(projectConfig.root, 'g'), schema.relativeToRootDestination); const newProject = JSON.parse(newProjectString); // Create a new project with the root replaced (0, devkit_1.addProjectConfiguration)(tree, schema.newProjectName, newProject); } exports.createProjectConfigurationInNewDestination = createProjectConfigurationInNewDestination; //# sourceMappingURL=create-project-configuration-in-new-destination.js.map