Skip to content

Commit c588cc7

Browse files
janwiebedroidFrozenPandaz
authored andcommitted
fix(js): call normalizePath on generated importPath (#13037)
(cherry picked from commit 2818f2e)
1 parent b3541f6 commit c588cc7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/js/src/utils/inline.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ExecutorContext, ProjectGraphProjectNode } from '@nrwl/devkit';
2-
import { readJsonFile } from '@nrwl/devkit';
2+
import { readJsonFile, normalizePath } from '@nrwl/devkit';
33
import {
44
copySync,
55
readdirSync,
@@ -285,7 +285,11 @@ function recursiveUpdateImport(
285285
const fileContent = readFileSync(filePath, 'utf-8');
286286
const updatedContent = fileContent.replace(importRegex, (matched) => {
287287
const result = matched.replace(/['"]/g, '');
288-
return `"${relative(dirPath, inlinedDepsDestOutputRecord[result])}"`;
288+
const importPath = `"${relative(
289+
dirPath,
290+
inlinedDepsDestOutputRecord[result]
291+
)}"`;
292+
return normalizePath(importPath);
289293
});
290294
writeFileSync(filePath, updatedContent);
291295
} else if (file.isDirectory()) {

0 commit comments

Comments
 (0)