鍍金池/ 問答/HTML/ vue配置postcss,dev正常,但build報錯

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, // 視窗的寬度,對應(yīng)的是我們設(shè)計稿的寬度,一般是750
            viewportHeight: 1334, // 視窗的高度,根據(jù)750設(shè)備的寬度來指定,一般指定1334,也可以不配置。
            unitPrecision: 3, // 指定`px`轉(zhuǎn)換為視窗單位值的小數(shù)位數(shù)(很多時候無法整除)
            viewportUnit: 'vw', // 指定需要轉(zhuǎn)換成的視窗單位,建議使用vw
            selectorBlackList: ['.ignore', '.hairlines'], // 指定不轉(zhuǎn)換為視窗單位的類,可以自定義,可以無限添加,建議定義一至兩個通用的類名。
            minPixelValue: 1, // 小于或等于`1px`不轉(zhuǎn)換為視窗單位,你也可以設(shè)置為你想要的值。
            mediaQuery: false // 允許在媒體查詢中轉(zhuǎn)換`px`
        },
        "postcss-viewport-units":{},
        "cssnano": {
            preset: "advanced",
            autoprefixer: false,
            "postcss-zindex": false
        }
    }
}
回答
編輯回答
負(fù)我心

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

2018年8月6日 16:55