打包前端项目的时候遇到报错

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.

在这里插入图片描述
在网上找了解决办法:
把webpack.prod.conf.js下列代码进行注释就可以了

    new OptimizeCSSPlugin({
      cssProcessorOptions: config.build.productionSourceMap
        ? { safe: true, map: { inline: false } }
        : { safe: true }
    }),

在这里插入图片描述

Logo

前往低代码交流专区

更多推荐