zhgdyunapp_vue3/postcss.config.js

42 lines
1.7 KiB
JavaScript
Raw Normal View History

// // postcss.config.js
// const path = require('path')
// module.exports = {
// parser: 'postcss-comment',
// plugins: {
// 'postcss-import': {
// resolve(id, basedir, importOptions) {
// if (id.startsWith('~@/')) {
// return path.resolve(process.env.UNI_INPUT_DIR, id.substr(3))
// } else if (id.startsWith('@/')) {
// return path.resolve(process.env.UNI_INPUT_DIR, id.substr(2))
// } else if (id.startsWith('/') && !id.startsWith('//')) {
// return path.resolve(process.env.UNI_INPUT_DIR, id.substr(1))
// }
// return id
// }
// },
// 'autoprefixer': {
// overrideBrowserslist: ["Android >= 4", "ios >= 8"],
// remove: process.env.UNI_PLATFORM !== 'h5'
// },
// // 借助postcss-px-to-viewport插件实现rpx转px文档https://github.com/evrone/postcss-px-to-viewport/blob/master/README_CN.md
// // 以下配置可以将rpx转换为1/2的px如20rpx=10px如果要调整比例可以调整 viewportWidth 来实现
// 'postcss-px-to-viewport': {
// unitToConvert: 'rpx',
// viewportWidth: 1000,
// unitPrecision: 5,
// propList: ['*'],
// viewportUnit: 'vw',
// fontViewportUnit: 'vw',
// selectorBlackList: [],
// minPixelValue: 1,
// mediaQuery: false,
// replace: true,
// exclude: undefined,
// include: undefined,
// landscape: false
// },
// '@dcloudio/vue-cli-plugin-uni/packages/postcss': {}
// }
// }