Skip to content

Commit

Permalink
fix(node): add flag to skip calculate resolve mappings for yarn works…
Browse files Browse the repository at this point in the history
…paces and the likes

ISSUES CLOSED: nrwl#11221
  • Loading branch information
nartc committed Jul 21, 2022
1 parent 8c7b76e commit 338af01
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/generated/packages/node.json
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,11 @@
"type": "boolean",
"description": "Enable re-building when files change.",
"default": true
},
"skipCalculateMappings": {
"type": "boolean",
"description": "Skip logic of resolving mappings for Nx workspaces. Yarn/NPM/PNPM workspaces where packages are installed as node_modules can disable this",
"default": false
}
},
"additionalProperties": false,
Expand Down
4 changes: 3 additions & 1 deletion packages/node/src/executors/node/node.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ export async function* nodeExecutor(
}
}

const mappings = calculateResolveMappings(context, options);
const mappings = options.skipCalculateMappings
? {}
: calculateResolveMappings(context, options);
for await (const event of startBuild(options, context)) {
if (!event.success) {
logger.error('There was an error with the build. See above.');
Expand Down
1 change: 1 addition & 0 deletions packages/node/src/executors/node/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export interface NodeExecutorOptions {
host: string;
port: number;
watch?: boolean;
skipCalculateMappings?: boolean;
}
5 changes: 5 additions & 0 deletions packages/node/src/executors/node/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
"type": "boolean",
"description": "Enable re-building when files change.",
"default": true
},
"skipCalculateMappings": {
"type": "boolean",
"description": "Skip logic of resolving mappings for Nx workspaces. Yarn/NPM/PNPM workspaces where packages are installed as node_modules can disable this",
"default": false
}
},
"additionalProperties": false,
Expand Down

0 comments on commit 338af01

Please sign in to comment.