- 启用pxtransform插件进行px单位转换 - 配置基准字体大小为14px - 设置最小根字体大小为14px
@@ -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: {}