@@ -47,15 +47,15 @@ const injectInlineSourceMap = ({
47
47
}
48
48
49
49
export function compile (
50
- sourcecode : string ,
50
+ sourcecode : string | undefined ,
51
51
filename : string ,
52
52
options : ts . CompilerOptions & {
53
53
fallbackToTs ?: ( filename : string ) => boolean
54
54
} ,
55
55
) : string
56
56
57
57
export function compile (
58
- sourcecode : string ,
58
+ sourcecode : string | undefined ,
59
59
filename : string ,
60
60
options : ts . CompilerOptions & {
61
61
fallbackToTs ?: ( filename : string ) => boolean
@@ -64,7 +64,7 @@ export function compile(
64
64
) : string
65
65
66
66
export function compile (
67
- sourcecode : string ,
67
+ sourcecode : string | undefined ,
68
68
filename : string ,
69
69
options : ts . CompilerOptions & {
70
70
fallbackToTs ?: ( filename : string ) => boolean
@@ -73,7 +73,7 @@ export function compile(
73
73
) : Promise < string >
74
74
75
75
export function compile (
76
- sourcecode : string ,
76
+ sourcecode : string | undefined ,
77
77
filename : string ,
78
78
options : ts . CompilerOptions & {
79
79
fallbackToTs ?: ( filename : string ) => boolean
@@ -82,14 +82,15 @@ export function compile(
82
82
) : string | Promise < string >
83
83
84
84
export function compile (
85
- sourcecode : string ,
85
+ sourcecode : string | undefined ,
86
86
filename : string ,
87
87
options : ts . CompilerOptions & {
88
88
fallbackToTs ?: ( filename : string ) => boolean
89
89
} ,
90
90
async = false ,
91
91
) {
92
92
if (
93
+ typeof sourcecode === 'undefined' ||
93
94
( filename . includes ( 'node_modules' ) && ! AVAILABLE_TS_EXTENSION_PATTERN . test ( filename ) ) ||
94
95
! AVAILABLE_EXTENSION_PATTERN . test ( filename )
95
96
) {
0 commit comments