Skip to content

Commit

Permalink
fix: use .d.ts instead of .vue.d.ts for Vue declarations (#336)
Browse files Browse the repository at this point in the history
* - fix for vue declaration file names

* fix: use .d.ts instead of .vue.d.ts for Vue declarations

- `.vue.d.ts` was recommended by the `rollup-plugin-vue` maintainers
  back when this code was originally written, but apparently it causes
  problems with some imports
  - plain `.d.ts` seems to work fine according to users
    - and plain is the standard in TS too I believe

Co-authored-by: ezolenko <[email protected]>
  • Loading branch information
agilgur5 and ezolenko authored Jun 1, 2022
1 parent 8e58037 commit e145d0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ const typescript: PluginImpl<RPT2Options> = (options) =>

let fileName = entry.name;
if (fileName.includes("?")) // HACK for rollup-plugin-vue, it creates virtual modules in form 'file.vue?rollup-plugin-vue=script.ts'
fileName = fileName.split("?", 1) + extension;
fileName = fileName.split(".vue?", 1) + extension;

// If 'useTsconfigDeclarationDir' is given in the
// plugin options, directly write to the path provided
Expand Down

0 comments on commit e145d0b

Please sign in to comment.