File tree 4 files changed +15
-2
lines changed
4 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 27
27
"exports" : {
28
28
"./package.json" : " ./package.json" ,
29
29
"." : " ./dist/loader.mjs" ,
30
+ "./patch-repl" : " ./dist/patch-repl.cjs" ,
30
31
"./cjs" : " ./dist/cjs/index.cjs" ,
31
32
"./cjs/api" : {
32
33
"import" : {
Original file line number Diff line number Diff line change 1
- import './patch-repl.js' ;
2
-
3
1
// Hook require() to transform to CJS
4
2
// eslint-disable-next-line import-x/no-unresolved
5
3
require ( './cjs/index.cjs' ) ;
Original file line number Diff line number Diff line change @@ -33,12 +33,23 @@ export const run = (
33
33
}
34
34
}
35
35
36
+ const shouldPatchRepl = argv . filter ( flag => ( flag !== '-i' && flag !== '--interactive' ) ) . length === 0 ;
37
+
36
38
return spawn (
37
39
process . execPath ,
38
40
[
39
41
'--require' ,
40
42
require . resolve ( './preflight.cjs' ) ,
41
43
44
+ ...(
45
+ shouldPatchRepl
46
+ ? [
47
+ '--require' ,
48
+ require . resolve ( './patch-repl.cjs' ) ,
49
+ ]
50
+ : [ ]
51
+ ) ,
52
+
42
53
isFeatureSupported ( moduleRegister ) ? '--import' : '--loader' ,
43
54
pathToFileURL ( require . resolve ( './loader.mjs' ) ) . toString ( ) ,
44
55
Original file line number Diff line number Diff line change @@ -154,6 +154,9 @@ export const files = {
154
154
!(typeof m.default === 'object' && ('default' in m.default)),
155
155
));
156
156
exports.named = 'named';
157
+
158
+ // https://github.com/privatenumber/tsx/issues/248
159
+ process.setUncaughtExceptionCaptureCallback(console.error);
157
160
` ,
158
161
159
162
mjs : {
You can’t perform that action at this time.
0 commit comments