Skip to content

Commit 5ef6bc1

Browse files
committed
debugging
1 parent da282e7 commit 5ef6bc1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/data-context/src/data/ProjectConfigIpc.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ export class ProjectConfigIpc extends EventEmitter {
271271
// ts-node for CommonJS
272272
// ts-node/esm for ESM
273273
if (hasTypeScriptInstalled(this.projectRoot)) {
274+
debug('found typescript in %s', this.projectRoot)
274275
if (isProjectUsingESModules) {
276+
debug(`using --experimental-specifier-resolution=node with --loader ${tsNodeEsm}`)
275277
// Use the ts-node/esm loader so they can use TypeScript with `"type": "module".
276278
// The loader API is experimental and will change.
277279
// The same can be said for the other alternative, esbuild, so this is the
@@ -294,6 +296,8 @@ export class ProjectConfigIpc extends EventEmitter {
294296
// so we need to load and evaluate the hook first using the `--require` module API.
295297
const tsNodeLoader = `--require "${tsNode}"`
296298

299+
debug(`using cjs with --require ${tsNode}`)
300+
297301
if (childOptions.env.NODE_OPTIONS) {
298302
childOptions.env.NODE_OPTIONS += ` ${tsNodeLoader}`
299303
} else {
@@ -303,6 +307,7 @@ export class ProjectConfigIpc extends EventEmitter {
303307
} else {
304308
// Just use Node's built-in ESM support.
305309
// TODO: Consider using userland `esbuild` with Node's --loader API to handle ESM.
310+
debug(`no typescript found, just use regular Node.js`)
306311
}
307312

308313
return fork(CHILD_PROCESS_FILE_PATH, configProcessArgs, childOptions)

0 commit comments

Comments
 (0)