Closed aaaristo closed 1 year ago
This solves it in my case:
create ./swc-register.js
const ts = require('typescript');
require('@swc-node/register/register').register({
target: ts.ScriptTarget.ES2018,
module: ts.ModuleKind.CommonJS,
moduleResolution: ts.ModuleResolutionKind.NodeJs,
jsx: 'react',
sourceMap: true,
esModuleInterop: true,
});
node -r ./swc-register.js my-script.js
It seems a bit counterintuitive to configure swc-node with tsconfig and not swcrc.
parseJsonConfigFileContent is quite slow on large projects, would it be possible to skip it and use .swcrc instead?
when removing the tsconfig.json node starts way faster, the problem is I cannot add jsx support. And it seems SWCRC=true has no effect.