We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6aea1ad commit 4332408Copy full SHA for 4332408
src/generate.ts
@@ -108,10 +108,14 @@ export function createGeneratePlugin({
108
(typeof options.entryFileNames === 'function'
109
? options.entryFileNames(chunk)
110
: options.entryFileNames) || '[name].js'
111
- if (!original.includes('.d') && chunk.name.endsWith('.d')) {
112
- return original.replace(RE_JS, '.$1ts')
+
+ if (!chunk.name.endsWith('.d')) return original
113
114
+ // already a dts file
115
+ if (RE_DTS.test(original)) {
116
+ return original.replace('[name]', chunk.name.slice(0, -2))
117
}
- return original
118
+ return original.replace(RE_JS, '.$1ts')
119
},
120
121
0 commit comments