Procházet zdrojové kódy

fix: 自动生成关闭

wanggaokun před 1 rokem
rodič
revize
3756e0ea43
1 změnil soubory, kde provedl 6 přidání a 5 odebrání
  1. 6 5
      build/plugins.ts

+ 6 - 5
build/plugins.ts

@@ -13,7 +13,6 @@ import vueSetupExtend from 'unplugin-vue-setup-extend-plus/vite'
 import { prismjsPlugin } from 'vite-plugin-prismjs'
 import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
 import IconsResolver from 'unplugin-icons/resolver'
-import path from 'path'
 
 /**
  * 创建 vite 插件
@@ -30,7 +29,7 @@ export const createVitePlugins = (viteEnv: ViteEnv): (PluginOption | PluginOptio
     // name 可以写在 script 标签上
     vueSetupExtend({}),
     // vue api
-    createAutoImport(path),
+    createAutoImport(),
     // 创建打包压缩配置
     createCompression(viteEnv),
     // 注入变量到 html 文件
@@ -126,7 +125,7 @@ const createVitePwa = (viteEnv: ViteEnv): PluginOption | PluginOption[] => {
  * @description ViteAutoImport
  * @param viteEnv
  */
-const createAutoImport = (path: any) => {
+const createAutoImport = () => {
   return autoImport({
     // 自动导入 Vue 相关函数
     imports: ['vue', 'vue-router', 'pinia'],
@@ -142,7 +141,9 @@ const createAutoImport = (path: any) => {
         prefix: 'Icon'
       })
     ],
-    vueTemplate: false, // 是否在 vue 模板中自动导入
-    dts: path.resolve(path.resolve(__dirname, '../src'), 'typings', 'auto-imports.d.ts')
+    vueTemplate: true, // 是否在 vue 模板中自动导入
+    // 生成后改为false
+    dts: false
+    // dts: path.resolve(path.resolve(__dirname, '../src'), 'typings', 'auto-imports.d.ts')
   })
 }