vue配置postcss,dev正常,但build报错

报错信息

.Error processing file: static/css/app.712bea8dd803afc0084e16e3c16e5d53.css
(node:5948) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Option safe was removed. Use parser: require("postcss-safe-parser")

(node:5948) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

.postcssrc.js

module.exports = {
    "plugins": {
        "postcss-import": {},
        "postcss-url": {},
        "postcss-aspect-ratio-mini": {},
        "postcss-write-svg": { utf8: false },
        "postcss-cssnext": {},
        "postcss-px-to-viewport": {
            viewportWidth: 750, // 视窗的宽度,对应的是我们设计稿的宽度,一般是750
            viewportHeight: 1334, // 视窗的高度,根据750设备的宽度来指定,一般指定1334,也可以不配置。
            unitPrecision: 3, // 指定`px`转换为视窗单位值的小数位数(很多时候无法整除)
            viewportUnit: 'vw', // 指定需要转换成的视窗单位,建议使用vw
            selectorBlackList: ['.ignore', '.hairlines'], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名。
            minPixelValue: 1, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值。
            mediaQuery: false // 允许在媒体查询中转换`px`
        },
        "postcss-viewport-units":{},
        "cssnano": {
            preset: "advanced",
            autoprefixer: false,
            "postcss-zindex": false
        }
    }
}
阅读 3.3k
1 个回答

Option safe was removed. Use parser: require("postcss-safe-parser")

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题