Skip to content

Commit

Permalink
revert: back to using vue.d.ts instead of .d.ts for Vue declarati…
Browse files Browse the repository at this point in the history
…ons (#410)

This reverts commit e145d0b.

- Per discussion on the original issue and reverted PR, it seems that the request to use `.d.ts` instead of `.vue.d.ts` was made in error
  - `.d.ts` seems to only be necessary if Vue users were importing `.vue` SFCs without extensions ("extensionless")
    - i.e. `import MyComponent from "./MyComponent"` instead of `import MyComponent from "./MyComponent.vue"`
  - and "extensionless" imports are no longer supported by the Vue team (but used to be)
  - requiring extensionless imports also breaks imports when extensions _are_ used
  - so these are not necessarily compatible with each other, but the Vue team support strongly suggests that `.vue.d.ts` would be the proper way forward
  • Loading branch information
agilgur5 committed Aug 18, 2022
1 parent c37dbf6 commit bc01134
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 @@ -345,7 +345,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(".vue?", 1) + extension;
fileName = fileName.split("?", 1) + extension;

// If 'useTsconfigDeclarationDir' is in plugin options, directly write to 'declarationDir'.
// This may not be under Rollup's output directory, and thus can't be emitted as an asset.
Expand Down

0 comments on commit bc01134

Please sign in to comment.