Skip to content
Permalink
Browse files
feat(cli): add --tsconfig flag to accept custom tsconfig path (#652)
* feat: expose tsconfig option

* write a test

* oops, remove the only function

* no need for a snapshot

Co-authored-by: EGOIST <hi@egoist.sh>
  • Loading branch information
jgoux and egoist committed Jun 10, 2022
1 parent be48b8b commit 58d0145e846def5a7a21a71ede8f58c2b72af92d
Showing 2 changed files with 16 additions and 0 deletions.
@@ -79,6 +79,7 @@ export async function main(options: Options = {}) {
default: 'node',
})
.option('--loader <ext=loader>', 'Specify the loader for a file extension')
.option('--tsconfig <filename>', 'Use a custom tsconfig')
.option('--config <filename>', 'Use a custom config file')
.option('--no-config', 'Disable config file')
.option('--shims', 'Enable cjs and esm shims')
@@ -439,6 +439,21 @@ test('onSuccess', async () => {
expect(logs.includes("world")).toEqual(true)
})

test('custom tsconfig', async () => {
await run(
getTestName(),
{
'input.ts': `export const foo = 'foo'`,
'tsconfig.build.json': `{
"compilerOptions": {
"baseUrl":"."
}
}`,
},
{ flags: ['--tsconfig', 'tsconfig.build.json'] }
)
})

test('support baseUrl and paths in tsconfig.json', async () => {
const { getFileContent } = await run(getTestName(), {
'input.ts': `export * from '@/foo'`,

1 comment on commit 58d0145

@vercel
Copy link

@vercel vercel bot commented on 58d0145 Jun 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

tsup – ./

tsup.vercel.app
tsup-git-main-egoist.vercel.app
tsup-egoist.vercel.app
tsup.egoist.sh

Please sign in to comment.