2025-04-16 14:13:32 +08:00
|
|
|
|
const { defineConfig } = require('@vue/cli-service');
|
|
|
|
|
|
|
2025-04-01 13:57:54 +08:00
|
|
|
|
module.exports = defineConfig({
|
2025-04-16 14:13:32 +08:00
|
|
|
|
transpileDependencies: true,
|
|
|
|
|
|
css: {
|
|
|
|
|
|
loaderOptions: {
|
|
|
|
|
|
postcss: {
|
|
|
|
|
|
postcssOptions: {
|
|
|
|
|
|
plugins: [
|
|
|
|
|
|
require('postcss-px-to-viewport')({
|
|
|
|
|
|
viewportWidth: 1600, // 视窗的宽度,对应设计稿宽度
|
|
|
|
|
|
viewportHeight: 900, // 视窗的高度,对应设计稿高度
|
|
|
|
|
|
unitPrecision: 3, // 指定 px 转换为视窗单位值的小数位数
|
|
|
|
|
|
viewportUnit: 'vw', // 指定需要转换成的视窗单位,vw 或者 vh
|
|
|
|
|
|
selectorBlackList: ['.ignore', '.hairlines'], // 指定不需要转换的类
|
|
|
|
|
|
minPixelValue: 1, // 小于或等于 1 px 不转换为视窗单位
|
|
|
|
|
|
mediaQuery: false // 允许在媒体查询中转换 px
|
|
|
|
|
|
})
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|