Skip to content

Commit

Permalink
fix(): fix tsconfig paths on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Jan 5, 2020
1 parent 0792293 commit 6ebe17a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/compiler/hooks/tsconfig-paths.hook.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as os from 'os';
import { dirname, posix } from 'path';
import tsPaths = require('tsconfig-paths');
import * as ts from 'typescript';
Expand Down Expand Up @@ -47,10 +48,13 @@ function getNotAliasedPath(
matcher: tsPaths.MatchPath,
text: string,
) {
const result = matcher(text, undefined, undefined, ['.ts', '.js']);
let result = matcher(text, undefined, undefined, ['.ts', '.js']);
if (!result) {
return;
}
if (os.platform() === 'win32') {
result = result.replace(/\\g/, '/');
}
const resolvedPath = posix.relative(dirname(sf.fileName), result) || './';
return resolvedPath[0] === '.' ? resolvedPath : './' + resolvedPath;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestjs/cli",
"version": "6.13.0",
"version": "6.13.1",
"description": "Nest - modern, fast, powerful node.js web framework (@cli)",
"publishConfig": {
"access": "public"
Expand Down

0 comments on commit 6ebe17a

Please sign in to comment.