Skip to content

Instantly share code, notes, and snippets.

@ZackDeRose
Created January 26, 2023 05:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZackDeRose/9bdfe23ce431292cb5f1d2483948b0fc to your computer and use it in GitHub Desktop.
Save ZackDeRose/9bdfe23ce431292cb5f1d2483948b0fc to your computer and use it in GitHub Desktop.
import { getWorkspaceLayout, names, Tree, updateJson } from '@nrwl/devkit'
// ...
function adjustDefaultDevPort(tree: Tree, options: AppGeneratorSchema) {
const { fileName } = names(options.name);
updateJson(tree, `apps/${fileName}-web/project.json`, (json) => ({
...json,
targets: {
...json.targets,
serve: {
...json.targets.serve,
options: {
...json.targets.serve.options,
port: options.frontendPort,
},
},
},
}));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment