[x] I can reproduce this issue when running this plugin on its own.
Other plugins, such as node-resolve are known to cause issues.
[x] I am running this plugin on .d.ts files generated by TypeScript.
The plugin can consume .ts and even .js files (with allowJs: true), but this is known to cause issues.
[x] This issue is not related to rolling up @types.
The plugin ignores these by default, unless respectExternal is set. @types can contain hand-crafted code which is known to cause issues.
Description
When the content of 'dist' exists and there is an index input or 'outdir' is not set in tsconfig, it will result in a compilation failure.
The first command describes the problem encountered, while the second and third command are two possible solutions I found. However, I don't think I should go with either of them, so I wanted to ask how the maintainer should handle this situation.
Error Message
[!] RollupError: src/a.ts (2:7): Expected '{', got 'type' (Note that you need plugins to import files that are not JavaScript)
src/a.ts (2:7)
1: export const a = 1
2: export type A = 1
^
RollupError: Expected '{', got 'type'
Checklist
node-resolve
are known to cause issues..d.ts
files generated by TypeScript. The plugin can consume.ts
and even.js
files (withallowJs: true
), but this is known to cause issues.@types
. The plugin ignores these by default, unlessrespectExternal
is set.@types
can contain hand-crafted code which is known to cause issues.Description
When the content of 'dist' exists and there is an index input or 'outdir' is not set in tsconfig, it will result in a compilation failure.
Code Snipped
reproduce repository.
The first command describes the problem encountered, while the second and third command are two possible solutions I found. However, I don't think I should go with either of them, so I wanted to ask how the maintainer should handle this situation.
Error Message