Skip to content

Commit 9a14af7

Browse files
authored
fix: be completely independent from typescript (#1433)
Or: to resolve typescript module correctly. The current code still has a "hard" top-level requiring for typescript, which may cause issues when installing ts-node globally and installing typescript locally (i.e. you have to install them both globally or both locally). Since we've already resolving typescript smartly in the code using `loadCompiler`, why not resolving `ScriptTarget` from the resolved one?
1 parent 385a469 commit 9a14af7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
ModuleTypeClassifier,
2424
} from './module-type-classifier';
2525
import { createResolverFunctions } from './resolver-functions';
26-
import { ScriptTarget } from 'typescript';
2726

2827
export { TSCommon };
2928
export {
@@ -551,7 +550,7 @@ export function create(rawOptions: CreateOptions = {}): Service {
551550
];
552551

553552
// Experimental REPL await is not compatible targets lower than ES2018
554-
const targetSupportsTla = config.options.target! >= ScriptTarget.ES2018;
553+
const targetSupportsTla = config.options.target! >= ts.ScriptTarget.ES2018;
555554
if (options.experimentalReplAwait === true && !targetSupportsTla) {
556555
throw new Error(
557556
'Experimental REPL await is not compatible with targets lower than ES2018'

0 commit comments

Comments
 (0)