// https://github.com/michael-ciniawsky/postcss-load-config
const {ROOT_VALUE} = require("@/assets/constant");
module.exports = {
plugins: {
autoprefixer: {
overrideBrowserslist: ['Android 4.1', 'iOS 7.1', 'Chrome > 31', 'ff > 31', 'ie >= 8']
},
'postcss-pxtorem': {
rootValue: ROOT_VALUE,
propList: ['*'],
//selectorBlackList: ['van-']
}
}
}
从外部引入直接报错,提示找不到@/assets/constant,但是明明有这个文件夹,里面也定义了:export const ROOT_VALUE = 37.5
require 导入的commonjs 模块,你写的这个配置,如果没有babel或tsc 转译,导出和导入是两种相互不通的模块类型,你试试直接导出commonjs