Skip to content

Commit

Permalink
feat(ts-node): register with module: "commonjs"
Browse files Browse the repository at this point in the history
  • Loading branch information
hasparus authored Apr 15, 2021
1 parent b4807f9 commit dc323b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit dc323b9

Please sign in to comment.