mirror of
https://github.com/ezolenko/rollup-plugin-typescript2.git
synced 2025-12-08 19:06:16 +00:00
revert: back to using vue.d.ts instead of .d.ts for Vue declarations (#410)
This reverts commit e145d0baebbbef1eec691b99d1ce0dce1e49f38c.
- 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
This commit is contained in:
parent
c37dbf6ee9
commit
bc01134c2b
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user