tsrun/ts/loader.ts

21 lines
740 B
TypeScript
Raw Normal View History

2022-03-12 13:43:54 +00:00
import * as plugins from './plugins.js';
import type { CompilerOptions } from 'typescript';
const defaultTsNodeOptions: plugins.tsNode.CreateOptions = {
compilerOptions: {
lib: ['dom'],
2022-03-24 17:47:16 +00:00
target: <any>'es2022', // Script Target should be a string -> 2 is for ES2015
2022-03-12 13:43:54 +00:00
experimentalDecorators: true,
2022-03-24 17:47:16 +00:00
useDefineForClassFields: false,
2022-03-12 13:43:54 +00:00
esModuleInterop: true,
strictNullChecks: false,
2022-05-25 08:55:35 +00:00
moduleResolution: <any>'nodenext',
2022-03-12 13:43:54 +00:00
module: <any>'ESNext',
importsNotUsedAsValues: <any>'preserve',
} as CompilerOptions,
esm: true,
skipIgnore: true,
transpileOnly: true
};
export const { resolve, load, getFormat, transformSource } = plugins.tsNode.createEsmHooks(plugins.tsNode.register(defaultTsNodeOptions)) as any;