From 31f184bfc65f3929b248a02049538c39b3868192 Mon Sep 17 00:00:00 2001 From: ezolenko Date: Mon, 6 Apr 2020 12:16:45 -0600 Subject: [PATCH 1/2] - fix for vue declaration file names --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 5986ffc1..baba8dfd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -328,7 +328,7 @@ const typescript: PluginImpl = (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 From 7ea1522ee4bd96c2c68fb3e0217c8a8bf0ae5cca Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Tue, 31 May 2022 18:22:04 -0400 Subject: [PATCH 2/2] 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 --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index baba8dfd..90ef7a3f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -328,7 +328,7 @@ const typescript: PluginImpl = (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(".vue?", 1) + extension; // If 'useTsconfigDeclarationDir' is given in the // plugin options, directly write to the path provided