Skip to content

Commit 58d0145

Browse files
jgouxEGOIST
and
EGOIST
authoredJun 10, 2022
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>
1 parent be48b8b commit 58d0145

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
 

‎src/cli-main.ts

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export async function main(options: Options = {}) {
7979
default: 'node',
8080
})
8181
.option('--loader <ext=loader>', 'Specify the loader for a file extension')
82+
.option('--tsconfig <filename>', 'Use a custom tsconfig')
8283
.option('--config <filename>', 'Use a custom config file')
8384
.option('--no-config', 'Disable config file')
8485
.option('--shims', 'Enable cjs and esm shims')

‎test/index.test.ts

+15
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,21 @@ test('onSuccess', async () => {
439439
expect(logs.includes("world")).toEqual(true)
440440
})
441441

442+
test('custom tsconfig', async () => {
443+
await run(
444+
getTestName(),
445+
{
446+
'input.ts': `export const foo = 'foo'`,
447+
'tsconfig.build.json': `{
448+
"compilerOptions": {
449+
"baseUrl":"."
450+
}
451+
}`,
452+
},
453+
{ flags: ['--tsconfig', 'tsconfig.build.json'] }
454+
)
455+
})
456+
442457
test('support baseUrl and paths in tsconfig.json', async () => {
443458
const { getFileContent } = await run(getTestName(), {
444459
'input.ts': `export * from '@/foo'`,

1 commit comments

Comments
 (1)

vercel[bot] commented on Jun 10, 2022

@vercel[bot]

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.