報(bào)錯(cuò)如下
\ building for production...Error processing file: static/css/app.e8b75d3d19abc5bbbd9bd916f459f0d0.css
(node:16424) UnhandledPromiseRejectionWarning: CssSyntaxError: E:\simou\static\css\app.e8b75d3d19abc5bbbd9bd916f459f0d0.css:1995:6: Unknown word
? ? at Input.error (E:\simou\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\input.js:130:16)
? ? at Parser.unknownWord (E:\simou\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\parser.js:563:22)
? ? at Parser.decl (E:\simou\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\parser.js:235:16)
? ? at Parser.other (E:\simou\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\parser.js:133:18)
? ? at Parser.parse (E:\simou\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\parser.js:77:16)
? ? at parse (E:\simou\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\parse.js:17:12)
? ? at new LazyResult (E:\simou\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\lazy-result.js:60:16)
? ? at Processor.<anonymous> (E:\simou\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\processor.js:138:12)
? ? at Processor.process (E:\simou\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\processor.js:117:23)
? ? at Function.creator.process (E:\simou\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\postcss.js:148:43)
? ? at OptimizeCssAssetsPlugin.processCss (E:\simou\node_modules\optimize-css-assets-webpack-plugin\index.js:63:19)
? ? at Object.processor (E:\simou\node_modules\optimize-css-assets-webpack-plugin\index.js:29:23)
? ? at E:\simou\node_modules\last-call-webpack-plugin\index.js:139:8
? ? at arrayEach (E:\simou\node_modules\lodash\_arrayEach.js:15:9)
? ? at forEach (E:\simou\node_modules\lodash\forEach.js:38:10)
? ? at LastCallWebpackPlugin.process (E:\simou\node_modules\last-call-webpack-plugin\index.js:136:3)
(node:16424) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:16424) [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.
首先想到的是插件不兼容? 因?yàn)轫?xiàng)目需求需要使用阂厣蹋康威視的插件雇卷;
想到就干扒最,在index.html和main.js中注釋掉相關(guān)插件繼續(xù)打包记焊,并沒有得到解決畏浆;
后面繼續(xù)查看錯(cuò)誤報(bào)告跺株,指出都是生成css與js的問題空繁,那么排查的方向就轉(zhuǎn)向webpack把敞;
最后在webpack.prod.conf.js中注釋了:
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
new OptimizeCSSPlugin({
? ? ? cssProcessorOptions: config.build.productionSourceMap
? ? ? ? ? { safe: true, map: { inline: false } }
? ? ? ? : { safe: true }
? ? }),
應(yīng)該是壓縮提取出的css和js落塑,重復(fù)壓縮纽疟??憾赁?還是多個(gè)文件壓縮到同一文件污朽??龙考?/
不太清楚蟆肆,記錄下來,哪位大神看到希望給些意見