File tree 1 file changed +5
-0
lines changed
packages/data-context/src/data
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -271,7 +271,9 @@ export class ProjectConfigIpc extends EventEmitter {
271
271
// ts-node for CommonJS
272
272
// ts-node/esm for ESM
273
273
if ( hasTypeScriptInstalled ( this . projectRoot ) ) {
274
+ debug ( 'found typescript in %s' , this . projectRoot )
274
275
if ( isProjectUsingESModules ) {
276
+ debug ( `using --experimental-specifier-resolution=node with --loader ${ tsNodeEsm } ` )
275
277
// Use the ts-node/esm loader so they can use TypeScript with `"type": "module".
276
278
// The loader API is experimental and will change.
277
279
// The same can be said for the other alternative, esbuild, so this is the
@@ -294,6 +296,8 @@ export class ProjectConfigIpc extends EventEmitter {
294
296
// so we need to load and evaluate the hook first using the `--require` module API.
295
297
const tsNodeLoader = `--require "${ tsNode } "`
296
298
299
+ debug ( `using cjs with --require ${ tsNode } ` )
300
+
297
301
if ( childOptions . env . NODE_OPTIONS ) {
298
302
childOptions . env . NODE_OPTIONS += ` ${ tsNodeLoader } `
299
303
} else {
@@ -303,6 +307,7 @@ export class ProjectConfigIpc extends EventEmitter {
303
307
} else {
304
308
// Just use Node's built-in ESM support.
305
309
// TODO: Consider using userland `esbuild` with Node's --loader API to handle ESM.
310
+ debug ( `no typescript found, just use regular Node.js` )
306
311
}
307
312
308
313
return fork ( CHILD_PROCESS_FILE_PATH , configProcessArgs , childOptions )
You can’t perform that action at this time.
0 commit comments