|
@@ -10,7 +10,13 @@ export default defineConfig(async (merge, { command, mode }) => {
|
10
|
10
|
const config = {
|
11
|
11
|
projectName: "civilized-miniapp",
|
12
|
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
|
20
|
deviceRatio: {
|
15
|
21
|
640: 2.34 / 2,
|
16
|
22
|
750: 1,
|
|
@@ -60,31 +66,35 @@ export default defineConfig(async (merge, { command, mode }) => {
|
60
|
66
|
router: {
|
61
|
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
|
76
|
postcss: {
|
71
|
|
-
|
|
77
|
+ autoprefixer: {
|
|
78
|
+ enable: true,
|
|
79
|
+ config: {
|
|
80
|
+ }
|
|
81
|
+ },
|
72
|
82
|
|
73
|
83
|
pxtransform: {
|
74
|
84
|
enable: true,
|
75
|
85
|
config: {
|
76
|
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
|
},
|