Browse Source

✨ feat(config): 添加postcss pxtransform配置

- 启用pxtransform插件进行px单位转换
- 配置基准字体大小为14px
- 设置最小根字体大小为14px
yourname 3 months ago
parent
commit
996c3e6a81
1 changed files with 7 additions and 0 deletions
  1. 7 0
      mini/config/index.ts

+ 7 - 0
mini/config/index.ts

@@ -96,6 +96,13 @@ export default defineConfig<'webpack5'>(async (merge, { command, mode }) => {
         chunkFilename: 'css/[name].[chunkhash].css'
       },
       postcss: {
+        pxtransform: {
+          enable: true,
+          config: {
+            baseFontSize : 14,
+            minRootSize: 14
+          }
+        },
         autoprefixer: {
           enable: true,
           config: {}