Yansen 1 year ago
parent
commit
5e89b4cf00
5 changed files with 12921 additions and 16497 deletions
  1. 9
    9
      babel.config.js
  2. 2
    2
      config/dev.js
  3. 29
    19
      config/index.js
  4. 2
    0
      src/app.js
  5. 12879
    16467
      yarn.lock

+ 9
- 9
babel.config.js View File

8
     }]
8
     }]
9
   ],
9
   ],
10
   plugins: [
10
   plugins: [
11
-    [
12
-      "import",
13
-      {
14
-        libraryName: "@antmjs/vantui",
15
-        libraryDirectory: "es",
16
-        style: (name) => `${name}/style/less`,
17
-      },
18
-      "@antmjs/vantui"
19
-    ]
11
+    // [
12
+    //   "import",
13
+    //   {
14
+    //     libraryName: "@antmjs/vantui",
15
+    //     libraryDirectory: "es",
16
+    //     style: (name) => `${name}/style/less`,
17
+    //   },
18
+    //   "@antmjs/vantui"
19
+    // ]
20
   ]
20
   ]
21
 }
21
 }

+ 2
- 2
config/dev.js View File

3
     NODE_ENV: '"development"',
3
     NODE_ENV: '"development"',
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-    HOST: '"http://127.0.0.1:9087"',
7
-    // HOST: '"http://192.168.89.13:9087"',
6
+    // HOST: '"http://127.0.0.1:9087"',
7
+    HOST: '"http://192.168.89.13:9087"',
8
     // HOST: '"https://wmcj.huoshannews.com"',
8
     // HOST: '"https://wmcj.huoshannews.com"',
9
     AD_IMAGE: '"https://h5.njyunzhi.com/images/citizen_banner.png"',
9
     AD_IMAGE: '"https://h5.njyunzhi.com/images/citizen_banner.png"',
10
     DEFAULT_POS: '"116.3476917447715,31.409912844296578"', // 霍山县人民政府 gcj02
10
     DEFAULT_POS: '"116.3476917447715,31.409912844296578"', // 霍山县人民政府 gcj02

+ 29
- 19
config/index.js View File

10
   const config = {
10
   const config = {
11
     projectName: "civilized-miniapp",
11
     projectName: "civilized-miniapp",
12
     date: "2024-03-21",
12
     date: "2024-03-21",
13
-    designWidth: 750,
13
+    designWidth(input) {
14
+      console.log('---->', input?.file)
15
+      // if (input?.file.replace(/\\+/g, '/').indexOf('@antmjs/vantui') > -1) {
16
+      //   return 750
17
+      // }
18
+      return 750
19
+    },
14
     deviceRatio: {
20
     deviceRatio: {
15
       640: 2.34 / 2,
21
       640: 2.34 / 2,
16
       750: 1,
22
       750: 1,
60
       router: {
66
       router: {
61
         mode: "hash",
67
         mode: "hash",
62
       },
68
       },
63
-      esnextModules: ["@antmjs/vantui"],
64
-      miniCssExtractPluginOption: {
65
-        ignoreOrder: true,
66
-        filename: "css/[name].[hash].css",
67
-        chunkFilename: "css/[id].css",
68
-      },
69
+      esnextModules: ['@antmjs'],
70
+      // miniCssExtractPluginOption: {
71
+      //   ignoreOrder: true,
72
+      //   filename: "css/[name].[hash].css",
73
+      //   chunkFilename: "css/[id].css",
74
+      // },
69
 
75
 
70
       postcss: {
76
       postcss: {
71
-      
77
+        autoprefixer: {
78
+          enable: true,
79
+          config: {
80
+          }
81
+        },
72
      
82
      
73
         pxtransform: {
83
         pxtransform: {
74
           enable: true,
84
           enable: true,
75
           config: {
85
           config: {
76
             // 设置rpx转换为目标单位为rem
86
             // 设置rpx转换为目标单位为rem
77
-            unitToRem: true,
78
-            // 设计稿宽度与 rem 基准值,默认设计稿宽度为 750,即 1rem = 75px
79
-            designWidth: 750,
80
-            // 可选,选择器黑名单
81
-            selectorBlackList: [],
82
-            // // 可选,替换rpx为其他单位后缀,例如 'px' 或 'rem'
83
-            propList: ["*"],
84
-            // 可选,媒体查询中是否禁用转换
85
-            mediaQuery: false,
86
-            // 可选,是否转换页面根节点字体大小,如body: font-size: 16px
87
-            minPixelValue: 0,
87
+            // unitToRem: true,
88
+            // // 设计稿宽度与 rem 基准值,默认设计稿宽度为 750,即 1rem = 75px
89
+            // designWidth: 750,
90
+            // // 可选,选择器黑名单
91
+            // selectorBlackList: [],
92
+            // // // 可选,替换rpx为其他单位后缀,例如 'px' 或 'rem'
93
+            // propList: ["*"],
94
+            // // 可选,媒体查询中是否禁用转换
95
+            // mediaQuery: false,
96
+            // // 可选,是否转换页面根节点字体大小,如body: font-size: 16px
97
+            // minPixelValue: 0,
88
 
98
 
89
           },
99
           },
90
         },
100
         },

+ 2
- 0
src/app.js View File

3
 import "./app.less";
3
 import "./app.less";
4
 import { useEffect, useMemo } from "react";
4
 import { useEffect, useMemo } from "react";
5
 // import wxsdk from "./utils/wx";
5
 // import wxsdk from "./utils/wx";
6
+import '@antmjs/vantui/lib/index.less'
7
+// import '@antmjs/vantui/lib/index.css'
6
 
8
 
7
 const App = (props) => {
9
 const App = (props) => {
8
   // useEffect(async() => {
10
   // useEffect(async() => {

+ 12879
- 16467
yarn.lock
File diff suppressed because it is too large
View File