@@ -12,9 +12,9 @@ var tsHandler
12
12
var getCompiledPath = require ( './get-compiled-path' )
13
13
var tmpDir = '.ts-node'
14
14
15
- var sourceMapSupportPath = require
16
- . resolve ( 'source-map-support' )
17
- . replace ( / \\ / g , '/ ')
15
+ const fixPath = ( p ) => p . replace ( / \\ / g , '/' ) . replace ( / \$ / g , '$$$$' )
16
+
17
+ var sourceMapSupportPath = require . resolve ( 'source-map-support ')
18
18
19
19
var extensions = [ '.ts' , '.tsx' ]
20
20
var empty = function ( ) { }
@@ -107,20 +107,17 @@ var compiler = {
107
107
)
108
108
fileData = fileData . replace (
109
109
'./get-compiled-path' ,
110
- path . join ( __dirname , 'get-compiled-path' ) . replace ( / \\ / g , '/' )
110
+ fixPath ( path . join ( __dirname , 'get-compiled-path' ) )
111
111
)
112
112
fileData = fileData . replace (
113
113
'var readyFile' ,
114
114
'var readyFile = "' + compiler . getCompilerReadyFilePath ( ) + '"'
115
115
)
116
116
fileData = fileData . replace (
117
117
'var sourceMapSupportPath' ,
118
- 'var sourceMapSupportPath = "' + sourceMapSupportPath + '"'
119
- )
120
- fileData = fileData . replace (
121
- / _ _ d i r n a m e / ,
122
- '"' + __dirname . replace ( / \\ / g, '/' ) + '"'
118
+ 'var sourceMapSupportPath = "' + fixPath ( sourceMapSupportPath ) + '"'
123
119
)
120
+ fileData = fileData . replace ( / _ _ d i r n a m e / , '"' + fixPath ( __dirname ) + '"' )
124
121
fs . writeFileSync ( compiler . getChildHookPath ( ) , fileData )
125
122
} ,
126
123
clearErrorCompile : ( ) => {
0 commit comments