File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -27,13 +27,27 @@ function replaceExtensions(extensionsRegex, name) {
27
27
function parseOptions ( tsconfigPath ) {
28
28
try {
29
29
var configFile = fs . readFileSync ( tsconfigPath , 'utf8' ) ;
30
- var rawConfig = ts . parseConfigFileText ( tsconfigPath , configFile ) ;
30
+ var rawConfig ;
31
+
32
+ if ( typeof ts . parseConfigFileText === 'function' ) {
33
+ rawConfig = ts . parseConfigFileText ( tsconfigPath , configFile ) ;
34
+ } else {
35
+ // >= 1.8
36
+ rawConfig = ts . parseConfigFileTextToJson ( tsconfigPath , configFile ) ;
37
+ }
31
38
32
39
if ( rawConfig . error ) {
33
40
throw new Error ( rawConfig . error . messageText ) ;
34
41
}
35
42
36
- var parsedConfig = ts . parseConfigFile ( rawConfig . config , ts . sys , path . dirname ( tsconfigPath ) ) ;
43
+ var parsedConfig ;
44
+
45
+ if ( typeof ts . parseConfigFile === 'function' ) {
46
+ parsedConfig = ts . parseConfigFile ( rawConfig . config , ts . sys , path . dirname ( tsconfigPath ) ) ;
47
+ } else {
48
+ // >= 1.8
49
+ parsedConfig = ts . convertCompilerOptionsFromJson ( rawConfig . config . compilerOptions , path . dirname ( tsconfigPath ) ) ;
50
+ }
37
51
38
52
if ( parsedConfig . errors && parsedConfig . errors . length ) {
39
53
throw new Error ( parsedConfig . errors . join ( ', ' ) ) ;
Original file line number Diff line number Diff line change 32
32
"json-stable-stringify" : " ^1.0.0"
33
33
},
34
34
"peerDependencies" : {
35
- "typescript" : " ^1.6.2 || ^1.7.0-dev"
35
+ "typescript" : " ^1.6.2 || ^1.7.0-dev || ^1.8.0-dev "
36
36
},
37
37
"devDependencies" : {
38
38
"broccoli" : " ^0.16.3" ,
You can’t perform that action at this time.
0 commit comments