Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(js): call normalizePath on generated importPath #13037

Merged
merged 1 commit into from Nov 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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