Skip to content

Commit

Permalink
fix: lose components types of components.d.ts (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
ycs77 committed Jul 6, 2022
1 parent 1fd5298 commit 55914b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/unplugin.ts
@@ -1,3 +1,4 @@
import { existsSync } from 'fs'
import { createUnplugin } from 'unplugin'
import { createFilter } from '@rollup/pluginutils'
import chokidar from 'chokidar'
Expand Down Expand Up @@ -56,9 +57,10 @@ export default createUnplugin<Options>((options = {}) => {
if (config.plugins.find(i => i.name === 'vite-plugin-vue2'))
ctx.setTransformer('vue2')

if (options.dts) {
if (ctx.options.dts) {
ctx.searchGlob()
ctx.generateDeclaration()
if (!existsSync(ctx.options.dts))
ctx.generateDeclaration()
}

if (config.build.watch && config.command === 'build')
Expand Down

0 comments on commit 55914b5

Please sign in to comment.