emitted dts is bundled source
See original GitHub issueThis is only an issue on v5.11.8.
src/index.ts
:
const message = 'Hello World'
export const main = () => {
console.log(message)
}
main()
dist/index.d.ts
:
const message = 'Hello World!';
const main = () => {
console.log(message);
};
main();
export { main };
expected dist/index.d.ts
(emitted on v5.11.7):
declare const main: () => void;
export { main };
tsup config:
{
"entry": ["src/index.ts"],
"format": ["esm"],
"dts": true
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
TypeStrong/dts-bundle: Export TypeScript .d.ts files ... - GitHub
This module is a naïve string-based approach at generating bundles from the .d.ts declaration files generated by a TypeScript compiler.
Read more >dts-bundle-webpack | Yarn - Package Manager
This is wrapper for dts-bundle plugin to use inside WebPack build. Generates bundle from the .d.ts declaration files generated by a TypeSript compiler....
Read more >tsup
Bundle your TypeScript library with no config, powered by esbuild. What can it bundle? Anything that's supported by Node.js natively, ...
Read more >Documentation - tsc CLI Options - TypeScript
Flag Type Default
‑‑allowJs boolean false
‑‑allowUmdGlobalAccess boolean false
‑‑allowUnreachableCode boolean
Read more >How to merge d.ts typings with dts-bundle and Webpack
It will create one file per .ts source, but we need one file. Here's dts-bundle join the game. Install it first from npm...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
should be fixed in v5.11.9
I got something different.
"tsup": "^5.11.9"
tsc’s dts is not the same as what tsup is emitting (noEmit:
false
ortrue
, bundle:false
)Source
packages/electron-esbuild/src/config/config.ts (may not be up to date with my local version)
tsup's dts
config-57276ad7.d.ts
tsc's dts
Why tsup emit a
config-5727ad8.d.ts
file (splitting
:true
orfalse
)? Whyimport 'vite'
,import 'webpack'
, …?