File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 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';
33import * as util from 'util' ;
44import { fileURLToPath } from 'url' ;
55
6- import sourceMapSupport = require ( '@cspotcode/source-map-support' ) ;
6+ import type * as _sourceMapSupport from '@cspotcode/source-map-support' ;
77import { BaseError } from 'make-error' ;
88import type * as _ts from 'typescript' ;
99
@@ -793,6 +793,8 @@ export function create(rawOptions: CreateOptions = {}): Service {
793793 // Install source map support and read from memory cache.
794794 installSourceMapSupport ( ) ;
795795 function installSourceMapSupport ( ) {
796+ const sourceMapSupport =
797+ require ( '@cspotcode/source-map-support' ) as typeof _sourceMapSupport ;
796798 sourceMapSupport . install ( {
797799 environment : 'node' ,
798800 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' ;
22import { homedir } from 'os' ;
33import { join } from 'path' ;
44import {
@@ -26,6 +26,13 @@ function getProcessTopLevelAwait() {
2626 }
2727 return _processTopLevelAwait ;
2828}
29+ let diff : typeof _diff ;
30+ function getDiffLines ( ) {
31+ if ( diff === undefined ) {
32+ diff = require ( 'diff' ) ;
33+ }
34+ return diff . diffLines ;
35+ }
2936
3037/** @internal */
3138export const EVAL_FILENAME = `[eval].ts` ;
@@ -544,7 +551,7 @@ function appendCompileAndEvalInput(options: {
544551 ) ;
545552
546553 // Use `diff` to check for new JavaScript to execute.
547- const changes = diffLines (
554+ const changes = getDiffLines ( ) (
548555 oldOutputWithoutSourcemapComment ,
549556 outputWithoutSourcemapComment
550557 ) ;
You can’t perform that action at this time.
0 commit comments