diff --git a/src/index.ts b/src/index.ts index f690413..d0d0ec5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,11 @@ import TypeScriptCompileError from './Errors/TypeScriptCompileError'; const loader: Loader = async (filePath: string) => { try { - require('ts-node/register'); + const tsNode = require("ts-node"); + tsNode.register({ + compilerOptions: { module: "commonjs" }, + }); + const result = require(filePath); return get(result, 'default', result);