Skip to content

Commit

Permalink
fix(js): call normalizePath on generated importPath (#13037)
Browse files Browse the repository at this point in the history
  • Loading branch information
janwiebedroid committed Nov 7, 2022
1 parent 8abc405 commit 2818f2e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/js/src/utils/inline.ts
@@ -1,5 +1,5 @@
import type { ExecutorContext, ProjectGraphProjectNode } from '@nrwl/devkit';
import { readJsonFile } from '@nrwl/devkit';
import { readJsonFile, normalizePath } from '@nrwl/devkit';
import {
copySync,
readdirSync,
Expand Down Expand Up @@ -285,7 +285,11 @@ function recursiveUpdateImport(
const fileContent = readFileSync(filePath, 'utf-8');
const updatedContent = fileContent.replace(importRegex, (matched) => {
const result = matched.replace(/['"]/g, '');
return `"${relative(dirPath, inlinedDepsDestOutputRecord[result])}"`;
const importPath = `"${relative(
dirPath,
inlinedDepsDestOutputRecord[result]
)}"`;
return normalizePath(importPath);
});
writeFileSync(filePath, updatedContent);
} else if (file.isDirectory()) {
Expand Down

0 comments on commit 2818f2e

Please sign in to comment.