Browse Source

chore: uild exclude icon

richard1015 3 years ago
parent
commit
c33c685b89

+ 4 - 2
jd/generate-nutui-taro-vue.cjs

@@ -8,13 +8,15 @@ let importScssStr = `\n`;
 const packages = [];
 const packages = [];
 config.nav.map((item) => {
 config.nav.map((item) => {
   item.packages.forEach((element) => {
   item.packages.forEach((element) => {
-    let { name } = element;
+    let { name,exclude } = element;
     const filePath = path.join(`src/packages/__VUE/${name.toLowerCase()}/index.taro.vue`);
     const filePath = path.join(`src/packages/__VUE/${name.toLowerCase()}/index.taro.vue`);
     importStr += `import ${name} from './__VUE/${name.toLowerCase()}/index${
     importStr += `import ${name} from './__VUE/${name.toLowerCase()}/index${
       fs.existsSync(filePath) ? '.taro' : ''
       fs.existsSync(filePath) ? '.taro' : ''
     }.vue';\n`;
     }.vue';\n`;
     importScssStr += `import './__VUE/${name.toLowerCase()}/index.scss';\n`;
     importScssStr += `import './__VUE/${name.toLowerCase()}/index.scss';\n`;
-    packages.push(name);
+    if (exclude != true) {
+      packages.push(name);
+    }
   });
   });
 });
 });
 let importCssVar = `import '../packages/styles/theme-deafult.scss';\n`;
 let importCssVar = `import '../packages/styles/theme-deafult.scss';\n`;

+ 4 - 2
jd/generate-nutui.cjs

@@ -8,10 +8,12 @@ let importScssStr = `\n`;
 const packages = [];
 const packages = [];
 config.nav.map((item) => {
 config.nav.map((item) => {
   item.packages.forEach((element) => {
   item.packages.forEach((element) => {
-    let { name, type } = element;
+    let { name, type, exclude } = element;
     importStr += `import ${name} from './__VUE/${name.toLowerCase()}/index${type === 'methods' ? '' : '.vue'}';\n`;
     importStr += `import ${name} from './__VUE/${name.toLowerCase()}/index${type === 'methods' ? '' : '.vue'}';\n`;
     importScssStr += `import './__VUE/${name.toLowerCase()}/index.scss';\n`;
     importScssStr += `import './__VUE/${name.toLowerCase()}/index.scss';\n`;
-    packages.push(name);
+    if (exclude != true) {
+      packages.push(name);
+    }
   });
   });
 });
 });
 let importCssVar = `import '../packages/styles/theme-deafult.scss';\n`;
 let importCssVar = `import '../packages/styles/theme-deafult.scss';\n`;

+ 4 - 2
jd/generate-themes.cjs

@@ -13,9 +13,11 @@ config.nav.map((item) => {
           path.resolve(__dirname, `../dist/packages/${folderName}/index.scss`)
           path.resolve(__dirname, `../dist/packages/${folderName}/index.scss`)
         )
         )
         .then((success) => {
         .then((success) => {
-          sassFileStr += `@import '../../packages/${folderName}/index.scss';\n`;
+          if (element.exclude != true) {
+            sassFileStr += `@import '../../packages/${folderName}/index.scss';\n`;
+          }
         })
         })
-        .catch((error) => {})
+        .catch((error) => { })
     );
     );
   });
   });
 });
 });

+ 1 - 0
src/config.json

@@ -130,6 +130,7 @@
           "show": true,
           "show": true,
           "desc": "图标",
           "desc": "图标",
           "author": "richard1015",
           "author": "richard1015",
+          "exclude": true,
           "styleDeps": []
           "styleDeps": []
         },
         },
         {
         {

+ 0 - 1
src/packages/__VUE/cell/doc.en-US.md

@@ -6,7 +6,6 @@ The cell is a single display item in the list.
 
 
 ### Install
 ### Install
 
 
-Register component globally via `app.use`, refer to [Component Registration](#/en-US/xinyunewlink) for more registration ways.
 
 
 ```javascript
 ```javascript
 import { createApp } from 'vue';
 import { createApp } from 'vue';

+ 0 - 1
src/packages/__VUE/cell/doc.md

@@ -6,7 +6,6 @@
 
 
 ### 安装
 ### 安装
 
 
-通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/xinyunewlink)。
 
 
 ```javascript
 ```javascript
 import { createApp } from 'vue';
 import { createApp } from 'vue';

+ 0 - 1
src/packages/__VUE/cell/doc.taro.md

@@ -6,7 +6,6 @@
 
 
 ### 安装
 ### 安装
 
 
-通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/xinyunewlink)。
 
 
 ```javascript
 ```javascript
 import { createApp } from 'vue';
 import { createApp } from 'vue';

+ 1 - 2
src/packages/__VUE/dialog/index.ts

@@ -1,7 +1,6 @@
 import Dialog from './index.vue';
 import Dialog from './index.vue';
 import { h, VNode, CSSProperties, Component } from 'vue';
 import { h, VNode, CSSProperties, Component } from 'vue';
 import Popup from '../popup/index.vue';
 import Popup from '../popup/index.vue';
-import Icon from '../icon/index.vue';
 import Button from '../button/index.vue';
 import Button from '../button/index.vue';
 import Overlay from '../overlay/index.vue';
 import Overlay from '../overlay/index.vue';
 import { CreateComponent } from '@/packages/utils/create';
 import { CreateComponent } from '@/packages/utils/create';
@@ -44,7 +43,7 @@ class DialogFunction {
     let options = Object.assign(this.options, _options);
     let options = Object.assign(this.options, _options);
     const { unmount } = CreateComponent(options, {
     const { unmount } = CreateComponent(options, {
       name: 'dialog',
       name: 'dialog',
-      components: [Popup, Icon, Button, Overlay],
+      components: [Popup, Button, Overlay],
       wrapper: (elWarp: any, root: any) => {
       wrapper: (elWarp: any, root: any) => {
         return {
         return {
           setup() {
           setup() {

+ 0 - 1
src/packages/__VUE/icon/index.scss

@@ -1 +0,0 @@
-@import '@nutui/icons-vue/dist/style_iconfont.css';

+ 1 - 0
src/packages/__VUE/icon/index.vue

@@ -1,4 +1,5 @@
 <script lang="ts">
 <script lang="ts">
+import '@nutui/icons-vue/dist/style_iconfont.css';
 import { createComponent } from '@/packages/utils/create';
 import { createComponent } from '@/packages/utils/create';
 const { create } = createComponent('icon');
 const { create } = createComponent('icon');
 export default /* @__PURE__ */ create({});
 export default /* @__PURE__ */ create({});

+ 1 - 2
src/packages/__VUE/imagepreview/index.ts

@@ -7,7 +7,6 @@ import Popup from '../popup/index.vue';
 import Video from '../video/index.vue';
 import Video from '../video/index.vue';
 import Swiper from '../swiper/index.vue';
 import Swiper from '../swiper/index.vue';
 import SwiperItem from '../swiperitem/index.vue';
 import SwiperItem from '../swiperitem/index.vue';
-import Icon from '../icon/index.vue';
 import Overlay from '../overlay/index.vue';
 import Overlay from '../overlay/index.vue';
 
 
 export class ImagePreviewOptions {
 export class ImagePreviewOptions {
@@ -40,7 +39,7 @@ class ImagePreviewFunction {
     const options = Object.assign(this.options, _options);
     const options = Object.assign(this.options, _options);
     const { instance, unmount } = CreateComponent(options, {
     const { instance, unmount } = CreateComponent(options, {
       name: 'imagepreview',
       name: 'imagepreview',
-      components: [Popup, Video, Swiper, SwiperItem, Icon, Overlay],
+      components: [Popup, Video, Swiper, SwiperItem, Overlay],
       wrapper: () => {
       wrapper: () => {
         return {
         return {
           setup() {
           setup() {

+ 0 - 6
src/packages/styles/theme-deafult.scss

@@ -152,12 +152,6 @@ page {
   --nut-divider-vertical-border-left: rgba(0, 0, 0, 0.06);
   --nut-divider-vertical-border-left: rgba(0, 0, 0, 0.06);
   --nut-divider-vertical-margin: 0 8px;
   --nut-divider-vertical-margin: 0 8px;
 
 
-  // icon
-
-  --nut-icon-height: 20px;
-  --nut-icon-width: 20px;
-  --nut-icon-line-height: 20px;
-
   // uploader
   // uploader
 
 
   --nut-uploader-picture-width: 100px;
   --nut-uploader-picture-width: 100px;

+ 0 - 6
src/packages/styles/theme-jdt.scss

@@ -140,12 +140,6 @@ page {
   --nut-divider-vertical-border-left: rgba(0, 0, 0, 0.06);
   --nut-divider-vertical-border-left: rgba(0, 0, 0, 0.06);
   --nut-divider-vertical-margin: 0 8px;
   --nut-divider-vertical-margin: 0 8px;
 
 
-  // icon
-
-  --nut-icon-height: 20px;
-  --nut-icon-width: 20px;
-  --nut-icon-line-height: 20px;
-
   // uploader
   // uploader
 
 
   --nut-uploader-picture-width: 100px;
   --nut-uploader-picture-width: 100px;

+ 4 - 1
src/sites/mobile-taro/vue/config/index.js

@@ -25,7 +25,10 @@ const config = {
     options: {}
     options: {}
   },
   },
   framework: 'vue3',
   framework: 'vue3',
-  compiler: 'webpack5',
+  compiler: {
+    type: 'webpack5',
+    prebundle: { enable: false }
+  },
   mini: {
   mini: {
     postcss: {
     postcss: {
       pxtransform: {
       pxtransform: {

+ 4 - 2
vite.config.build.disperse.ts

@@ -14,8 +14,10 @@ let input = {};
 
 
 configPkg.nav.map((item) => {
 configPkg.nav.map((item) => {
   item.packages.forEach((element) => {
   item.packages.forEach((element) => {
-    let { name, type } = element;
-    input[name] = `./src/packages/__VUE/${name.toLowerCase()}/index${type === 'methods' ? '.ts' : '.vue'}`;
+    let { name, type, exclude } = element;
+    if (exclude != true) {
+      input[name] = `./src/packages/__VUE/${name.toLowerCase()}/index${type === 'methods' ? '.ts' : '.vue'}`;
+    }
   });
   });
 });
 });
 
 

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

@@ -15,10 +15,12 @@ let input = {};
 
 
 configPkg.nav.map((item) => {
 configPkg.nav.map((item) => {
   item.packages.forEach((element) => {
   item.packages.forEach((element) => {
-    let { name } = element;
+    let { name, exclude } = element;
     // if (name.toLowerCase().indexOf('calendar') != -1) {
     // if (name.toLowerCase().indexOf('calendar') != -1) {
-    const filePath = path.join(`./src/packages/__VUE/${name.toLowerCase()}/index.taro.vue`);
-    input[name] = `./src/packages/__VUE/${name.toLowerCase()}/index${fs.existsSync(filePath) ? '.taro' : ''}.vue`;
+    if (exclude != true) {
+      const filePath = path.join(`./src/packages/__VUE/${name.toLowerCase()}/index.taro.vue`);
+      input[name] = `./src/packages/__VUE/${name.toLowerCase()}/index${fs.existsSync(filePath) ? '.taro' : ''}.vue`;
+    }
     // }
     // }
   });
   });
 });
 });