fix(js): use absolute filetorun path (#30091)

Fix a bug introduced in #30087

#### Current Behavior
The `@nx/js` plugins throw an error when the project is served in the
project root but not in the workspace root.

#### Expected Behavior
Ensure that `nx run $project:serve` works correctly both in the
workspace root and the project root, restoring the previous behavior.

#### Related Issue(s)
Fixes #30087
This commit is contained in:
MisterPandaPooh 2025-02-25 13:44:51 +02:00 committed by GitHub
parent 2fc1945615
commit 4fc52cf836
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -404,7 +404,7 @@ function getFileToRun(
const outputFilePath = interpolate(outputPath, {
projectName: project.name,
projectRoot: project.data.root,
workspaceRoot: '',
workspaceRoot: context.root,
});
return path.join(outputFilePath, 'main.js');
}