File tree 2 files changed +12
-3
lines changed
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { Module } from 'module';
3
3
import * as util from 'util' ;
4
4
import { fileURLToPath } from 'url' ;
5
5
6
- import sourceMapSupport = require ( '@cspotcode/source-map-support' ) ;
6
+ import type * as _sourceMapSupport from '@cspotcode/source-map-support' ;
7
7
import { BaseError } from 'make-error' ;
8
8
import type * as _ts from 'typescript' ;
9
9
@@ -793,6 +793,8 @@ export function create(rawOptions: CreateOptions = {}): Service {
793
793
// Install source map support and read from memory cache.
794
794
installSourceMapSupport ( ) ;
795
795
function installSourceMapSupport ( ) {
796
+ const sourceMapSupport =
797
+ require ( '@cspotcode/source-map-support' ) as typeof _sourceMapSupport ;
796
798
sourceMapSupport . install ( {
797
799
environment : 'node' ,
798
800
retrieveFile ( pathOrUrl : string ) {
Original file line number Diff line number Diff line change 1
- import { diffLines } from 'diff' ;
1
+ import type * as _diff from 'diff' ;
2
2
import { homedir } from 'os' ;
3
3
import { join } from 'path' ;
4
4
import {
@@ -26,6 +26,13 @@ function getProcessTopLevelAwait() {
26
26
}
27
27
return _processTopLevelAwait ;
28
28
}
29
+ let diff : typeof _diff ;
30
+ function getDiffLines ( ) {
31
+ if ( diff === undefined ) {
32
+ diff = require ( 'diff' ) ;
33
+ }
34
+ return diff . diffLines ;
35
+ }
29
36
30
37
/** @internal */
31
38
export const EVAL_FILENAME = `[eval].ts` ;
@@ -544,7 +551,7 @@ function appendCompileAndEvalInput(options: {
544
551
) ;
545
552
546
553
// Use `diff` to check for new JavaScript to execute.
547
- const changes = diffLines (
554
+ const changes = getDiffLines ( ) (
548
555
oldOutputWithoutSourcemapComment ,
549
556
outputWithoutSourcemapComment
550
557
) ;
You can’t perform that action at this time.
0 commit comments