-
-
Notifications
You must be signed in to change notification settings - Fork 260
Open
Description
In 7.1, #934 made declaration files for each format.
Here is my tsup.config.ts
file:
export default defineConfig({
entry: ["src/index.ts"],
format: ["cjs", "esm"],
legacyOutput: true,
splitting: false,
sourcemap: false,
clean: true,
dts: true,
minify: true,
});
I'm using legacyOutput
mode, which
Outputs different formats to different folder instead of using different extensions
And here is the list of the files produced:
$ ls dist
esm index.d.mts index.d.ts index.js
$ ls dist/esm
index.js
Meaning, that the esm
bundle is located in the corresponding folder.
However, its declaration file (index.d.mts
) is not.
Moreover, it's impossible to use onSuccess
callback for running fs.rename
(in order to move index.d.mts
into esm
folder), since that callback is being fired BEFORE making declarations.
Could you please fix it by placing the declaration files into the same directories where you put the bundles?
Also, in legacy mode, the declaration filename should be .d.ts
instead of .d.mts
.
andrewbranch, sentience, gilbarbara and hanseartic
Metadata
Metadata
Assignees
Labels
No labels