Skip to content

Commit

Permalink
fix(nextjs): fix inlined workspace root in .nx-helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Jul 25, 2024
1 parent 1774edd commit 8dc6383
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ export function getWithNxContent(
index: getWithNxContextDeclaration.getStart(withNxSource),
text: stripIndents`function getWithNxContext() {
return {
workspaceRoot: '${workspaceRoot}',
workspaceRoot: '${
// For Windows, paths like C:\Users\foo\bar need to be written as C:\\Users\\foo\\bar,
// or else when the file is read back, the single "\" will be treated as an escape character.
workspaceRoot.replaceAll('\\', '\\\\')
}',
libsDir: '${workspaceLayout().libsDir}'
}
}`,
Expand Down

0 comments on commit 8dc6383

Please sign in to comment.