浏览代码

fix: dts rule edit

richard1015 3 年之前
父节点
当前提交
6423da0c70
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 3 3
      vite.config.build.disperse.ts
  2. 3 3
      vite.config.build.taro.vue.disperse.ts

+ 3 - 3
vite.config.build.disperse.ts

@@ -38,14 +38,14 @@ declare type Install<T> = T & {
   install(app: App): void;
 };
 `;
-        const start = 'declare const _default:';
-        const end = ';\nexport default _default;\n';
+        const start = 'declare const _sfc_main:';
+        const end = ';\nexport default _sfc_main;\n';
         const remain = `
 declare module 'vue' {
   interface GlobalComponents {
       Nut${Object.keys(input).find(
         (item: string) => item.toLowerCase() === filePath.split('/').slice(-2)[0]
-      )}: typeof _default;
+      )}: typeof _sfc_main;
   }
 }     
       `;

+ 3 - 3
vite.config.build.taro.vue.disperse.ts

@@ -40,14 +40,14 @@ declare type Install<T> = T & {
   install(app: App): void;
 };
 `;
-        const start = 'declare const _default:';
-        const end = ';\nexport default _default;\n';
+        const start = 'declare const _sfc_main:';
+        const end = ';\nexport default _sfc_main;\n';
         const remain = `
 declare module 'vue' {
   interface GlobalComponents {
       Nut${Object.keys(input).find(
         (item: string) => item.toLowerCase() === filePath.split('/').slice(-2)[0]
-      )}: typeof _default;
+      )}: typeof _sfc_main;
   }
 }     
       `;