Skip to content

Commit

Permalink
fix: fix for nix filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Oct 7, 2020
1 parent cadc70b commit a3e1454
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/loader/src/replaceSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ ${contexts
let exports = null;
for (const context of contexts) {
const key = context.req.keys().find(k => {
const fullPath = path.join(context.folder, k).split('/').join('\\\\');
return doc.fileName === fullPath;
const fullPath = path.join(context.folder, k);
const normalizedPath = context.folder.indexOf('\\\\') >= 0 ? fullPath.split('/').join('\\\\') : fullPath;
return doc.fileName === normalizedPath;
});
if (key) {
exports = context.req(key);
Expand Down

0 comments on commit a3e1454

Please sign in to comment.