Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong (default) tsconfig.json used even though custom one is provided in tsup config #791

Closed
mkosir opened this issue Dec 1, 2022 · 4 comments · Fixed by Swatinem/rollup-plugin-dts#234 or #807
Labels

Comments

@mkosir
Copy link

mkosir commented Dec 1, 2022

I have my own tsconfig file path defined to be used for tsup

// tsup.config.ts
{
  entry: ['src/export-types/index.ts'],
  dts: { only: true },
  clean: true,
  tsconfig: 'tsconfig.build.json',
}

which has incremental: false

// tsconfig.build.json
{
  "compilerOptions": {
    ...
    "incremental": false,
    ...
}

Somehow tsup still pick up my (default) tsconfig.json, thats in the root of the project, which has "incremental": true and fails with an error:

CLI Building entry: src/export-types/index.ts
CLI Using tsconfig:tsconfig.build.json  <-- notice that tsup output in terminal states correct/defined tsconfig file
CLI tsup v6.5.0
CLI Using tsup config: tsup.config.ts
DTS Build start
error TS5074: Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified.

If I delete tsconfig.json in root folder (that of course must be present for VS code to pick it up, and for development config), tsup bundles with defined/correct tsconfig.build.json and no error.

@mkosir mkosir changed the title Wrong (default) tsconfig.json used even though custom one specified in tsup config Wrong (default) tsconfig.json used even though custom one is provided in tsup config Dec 2, 2022
@await-ovo
Copy link
Contributor

It looks like rollup-plugin-dts will still load tsconfig.json even though tsup provides a way to customize the tsconfig path: https://github.com/Swatinem/rollup-plugin-dts/blob/master/src/program.ts#L38

@mkosir
Copy link
Author

mkosir commented Dec 5, 2022

@await-ovo nice, thx for squashing this bug 🚀
iiuc for tsup this will be fixed when rollup-plugin-dts gets updated?

@await-ovo
Copy link
Contributor

Yes, I think after the latest changes to rollup-plugin-dts are released, tsup only needs a little change and it should be fine ~

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2023

🎉 This issue has been resolved in version 6.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

SeanZellmer added a commit to SeanZellmer/tsup that referenced this issue Feb 16, 2023
…e export {} for file that have no exports (#807)

Co-authored-by: EGOIST <[email protected]>
close egoist/tsup#762
close egoist/tsup#791
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants