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.

24 lines 949 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setDefaultCollection = void 0; const devkit_1 = require("@nrwl/devkit"); /** * Sets the default collection within the workspace. * * Will only set the defaultCollection if one does not exist or if it is not `@nrwl/workspace` * * @deprecated NxJson defaultCollection will be removed * @param host * @param collectionName Name of the collection to be set as the default */ function setDefaultCollection(host, collectionName) { const nxJson = (0, devkit_1.readNxJson)(host); nxJson.cli = nxJson.cli || {}; const defaultCollection = nxJson.cli.defaultCollection; if (!defaultCollection || defaultCollection === '@nrwl/workspace') { nxJson.cli.defaultCollection = collectionName; } (0, devkit_1.updateNxJson)(host, nxJson); } exports.setDefaultCollection = setDefaultCollection; //# sourceMappingURL=set-default-collection.js.map