diff --git a/packages/nx/src/project-graph/utils/project-configuration-utils.spec.ts b/packages/nx/src/project-graph/utils/project-configuration-utils.spec.ts index 82a70b656f..2807e854a3 100644 --- a/packages/nx/src/project-graph/utils/project-configuration-utils.spec.ts +++ b/packages/nx/src/project-graph/utils/project-configuration-utils.spec.ts @@ -1772,6 +1772,60 @@ describe('project-configuration-utils', () => { `); } }); + + it('should correctly set source maps', async () => { + const { sourceMaps } = await createProjectConfigurations( + undefined, + {}, + ['libs/a/project.json'], + [ + new LoadedNxPlugin(fakeTargetsPlugin, 'fake-targets-plugin'), + new LoadedNxPlugin(fakeTagPlugin, 'fake-tag-plugin'), + ] + ); + expect(sourceMaps).toMatchInlineSnapshot(` + { + "libs/a": { + "name": [ + "libs/a/project.json", + "fake-tag-plugin", + ], + "root": [ + "libs/a/project.json", + "fake-tag-plugin", + ], + "tags": [ + "libs/a/project.json", + "fake-tag-plugin", + ], + "tags.fake-lib": [ + "libs/a/project.json", + "fake-tag-plugin", + ], + "targets": [ + "libs/a/project.json", + "fake-targets-plugin", + ], + "targets.build": [ + "libs/a/project.json", + "fake-targets-plugin", + ], + "targets.build.executor": [ + "libs/a/project.json", + "fake-targets-plugin", + ], + "targets.build.options": [ + "libs/a/project.json", + "fake-targets-plugin", + ], + "targets.build.options.command": [ + "libs/a/project.json", + "fake-targets-plugin", + ], + }, + } + `); + }); }); }); diff --git a/packages/nx/src/project-graph/utils/project-configuration-utils.ts b/packages/nx/src/project-graph/utils/project-configuration-utils.ts index 8fe55f76c5..6af12c571d 100644 --- a/packages/nx/src/project-graph/utils/project-configuration-utils.ts +++ b/packages/nx/src/project-graph/utils/project-configuration-utils.ts @@ -459,7 +459,7 @@ function mergeCreateNodesResults( > = {}; for (const result of results.flat()) { - const [file, pluginName, nodes] = result; + const [pluginName, file, nodes] = result; const { projects: projectNodes, externalNodes: pluginExternalNodes } = nodes;