Skip to content

Commit 2c97f52

Browse files
committed
Resolve ts-node on behalf of the root application
1 parent 9d20e41 commit 2c97f52

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/transpilation/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export function resolvePlugin(
3636
const hasNoRequireHook = require.extensions[".ts"] === undefined;
3737
if (hasNoRequireHook && (resolved.endsWith(".ts") || resolved.endsWith(".tsx"))) {
3838
try {
39-
const tsNode: typeof import("ts-node") = require("ts-node");
39+
const tsNodePath = resolve.sync("ts-node", { basedir });
40+
const tsNode: typeof import("ts-node") = require(tsNodePath);
4041
tsNode.register({ transpileOnly: true });
4142
} catch (err) {
4243
if (err.code !== "MODULE_NOT_FOUND") throw err;

0 commit comments

Comments
 (0)