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 1fd5298 commit 55914b5Copy full SHA for 55914b5
src/core/unplugin.ts
@@ -1,3 +1,4 @@
1
+import { existsSync } from 'fs'
2
import { createUnplugin } from 'unplugin'
3
import { createFilter } from '@rollup/pluginutils'
4
import chokidar from 'chokidar'
@@ -56,9 +57,10 @@ export default createUnplugin<Options>((options = {}) => {
56
57
if (config.plugins.find(i => i.name === 'vite-plugin-vue2'))
58
ctx.setTransformer('vue2')
59
- if (options.dts) {
60
+ if (ctx.options.dts) {
61
ctx.searchGlob()
- ctx.generateDeclaration()
62
+ if (!existsSync(ctx.options.dts))
63
+ ctx.generateDeclaration()
64
}
65
66
if (config.build.watch && config.command === 'build')
0 commit comments