@@ -5,7 +5,7 @@ import { SourceNode } from "source-map";
55import * as ts from "typescript" ;
66import { CompilerOptions , isBundleEnabled , LuaTarget } from "../CompilerOptions" ;
77import { getLuaLibBundle } from "../LuaLib" ;
8- import { assert , cast , isNonNull , trimExtension } from "../utils" ;
8+ import { assert , cast , isNonNull , normalizeSlashes , trimExtension } from "../utils" ;
99import { Chunk , modulesToBundleChunks , modulesToChunks } from "./chunk" ;
1010import { createResolutionErrorDiagnostic } from "./diagnostics" ;
1111import { buildModule , Module } from "./module" ;
@@ -39,7 +39,7 @@ export class Transpilation {
3939
4040 this . projectDir =
4141 this . options . configFilePath !== undefined
42- ? path . dirname ( this . options . configFilePath )
42+ ? ts . getDirectoryPath ( this . options . configFilePath )
4343 : this . host . getCurrentDirectory ( ) ;
4444
4545 this . plugins = getPlugins ( this , extraPlugins ) ;
@@ -85,10 +85,10 @@ export class Transpilation {
8585
8686 let resolvedPath : string ;
8787 try {
88- const result = this . resolver . resolveSync ( { } , path . dirname ( issuer ) , request ) ;
88+ const result = this . resolver . resolveSync ( { } , ts . getDirectoryPath ( issuer ) , request ) ;
8989 assert ( typeof result === "string" , `Invalid resolution result: ${ result } ` ) ;
9090 // https://github.com/webpack/enhanced-resolve#escaping
91- resolvedPath = result . replace ( / \0 # / g, "#" ) ;
91+ resolvedPath = normalizeSlashes ( result . replace ( / \0 # / g, "#" ) ) ;
9292 } catch ( error ) {
9393 if ( ! isResolveError ( error ) ) throw error ;
9494 return { error : error . message } ;
0 commit comments