diff --git a/src/constants.ts b/src/constants.ts index d7c13f8e..96a662ab 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -77,9 +77,11 @@ export const tsExtensions = new Set(['ts', 'tsx', 'cts', 'mts']) export const DEFAULT_TS_CONFIG = { compilerOptions: { + target: 'ES2022', module: 'ESNext', moduleResolution: 'bundler', }, + include: ['src'], } export const BINARY_TAG = '$binary' diff --git a/test/integration/prepare-ts/index.test.ts b/test/integration/prepare-ts/index.test.ts index bcb306f0..b21c9f22 100644 --- a/test/integration/prepare-ts/index.test.ts +++ b/test/integration/prepare-ts/index.test.ts @@ -21,6 +21,22 @@ describe('integration prepare-ts', () => { it('should contain files', async () => { const { stdout } = job await assertContainFiles(dir, ['package.json', 'tsconfig.json']) + + const tsconfig = await fsp.readFile(join(dir, './tsconfig.json'), 'utf-8') + + expect(tsconfig).toMatchInlineSnapshot(` + "{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "bundler" + }, + "include": [ + "src" + ] + }" + `) + const pkgJson = JSON.parse( await fsp.readFile(join(dir, './package.json'), 'utf-8'), )