-
-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Description
Checklist
- I can reproduce this issue when running this plugin on its own.
Other plugins, such asnode-resolveare known to cause issues. - I am running this plugin on
.d.tsfiles generated by TypeScript.
The plugin can consume.tsand even.jsfiles (withallowJs: true), but this is known to cause issues. - This issue is not related to rolling up
@types.
The plugin ignores these by default, unlessrespectExternalis set.@typescan contain hand-crafted code which is known to cause issues.
Code Snipped
Entry point: (test.d.mts):
// Your code that is causing problems.
export type {myFunction} from "./myFunction.d.mts"Where myFunction.d.mts is:
export function myFunction(a : string) : string;And myFunction.mts is:
export function myFunction(a : string) : string {
return `${a}`
}Error Message
There is no error message but the output is:
declare function myFunction(a : string) : string {
return `${a}`
}
export { myFunction };Which obviously is wrong for a .d.mts file.
Removing the myFunction.mts file makes the plugin output the correct code:
declare function myFunction(a : string) : string;
export { myFunction };Rollup config:
import {dts} from "rollup-plugin-dts"
export default {
input: "./src/test.d.mts",
output: {},
plugins: [
dts()
]
}I made a repo for easy cloning & reproduce the problem described here.
Metadata
Metadata
Assignees
Labels
No labels