27 lines
999 B
JavaScript
27 lines
999 B
JavaScript
|
|
const { defineConfig } = require('@vue/cli-service');
|
|||
|
|
|
|||
|
|
module.exports = defineConfig({
|
|||
|
|
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
|
|||
|
|
})
|
|||
|
|
]
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
less: {
|
|||
|
|
additionalData: `@import "@/static/css/app.less";` // 注入全局变量文件
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|