1 Star 0 Fork 0

zhangjunya/woodfish

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
postcss.config.js 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
zhangjunya 提交于 2023-10-23 16:46 +08:00 . init
import path from 'path';
const judgeComponent = (file) => {
const ignore = ['@varlet', 'vant'];
return ignore.some((item) => path.join(file).includes(path.join('node_modules', item)));
};
export default () => {
return {
plugins: {
autoprefixer: {
overrideBrowserslist: [
"Android 4.1",
"iOS 7.1",
"Chrome > 31",
"ff > 31",
"ie >= 8",
],
},
"cnjm-postcss-px-to-viewport": {
unitToConvert: "px",
viewportWidth: 750,
unitPrecision: 6,
propList: ["*"],
viewportUnit: "vw",
fontViewportUnit: "vw",
minPixelValue: 1,
mediaQuery: true,
replace: true,
landscape: false,
landscapeUnit: "rem",
landscapeWidth: 1134,
include: [],
exclude: [], // 设置忽略文件,用正则做目录名匹配
customFun: ({ file }) => {
// 这个自定义的方法是针对处理@varlet组件下的设计稿为375问题
const designWidth = judgeComponent(file) ? 375 : 750;
return designWidth;
},
},
},
};
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/zhangjunya/woodfish.git
git@gitee.com:zhangjunya/woodfish.git
zhangjunya
woodfish
woodfish
main

搜索帮助