Browse Source

chore: fix build ts type tip #652

richard1015 4 years ago
parent
commit
2bad90cc28
1 changed files with 6 additions and 6 deletions
  1. 6 6
      jd/generate-types.js

+ 6 - 6
jd/generate-types.js

@@ -6,10 +6,10 @@ declare class UIComponent {
   static install(vue: App): void;
 }\n`;
 const packages = [];
-config.nav.map(item => {
-  item.packages.forEach(element => {
-    let { name, show } = element;
-    if (show) {
+config.nav.map((item) => {
+  item.packages.forEach((element) => {
+    let { name, show, exportEmpty } = element;
+    if (show || exportEmpty) {
       importStr += `declare class ${name} extends UIComponent {}\n`;
       packages.push(name);
     }
@@ -32,7 +32,7 @@ fs.outputFile(
   path.resolve(__dirname, '../dist/nutui.d.ts'),
   fileStr,
   'utf8',
-  error => {
+  (error) => {
     // logger.success(`${package_config_path} 文件写入成功`);
   }
 );
@@ -42,7 +42,7 @@ fs.outputFile(
 export default NutUI;
 export * from './nutui';`,
   'utf8',
-  error => {
+  (error) => {
     // logger.success(`${package_config_path} 文件写入成功`);
   }
 );