项目用到了vue,elementUI,结合Webpack打包运行的时候报错
web-im@1.0.0 dev F:\demo\web-im
webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
13% building modules 32/75 modules 43 active
…te&index=0!F:\demo\web-im\src\App.vue{ parser: “babylon” } is
deprecated; we now treat it as { pa rser: “babel” }. 94% asset
optimizationERROR Failed to compile with 1 errors
10:32:34error in ./node_modules/element-ui/lib/theme-chalk/index.css
Module build failed: ParseError:
F:\demo\web-im\node_modules\element-ui\lib\theme-chalk\index.css:1:63
1| var escape = require("…/…/…/css-loader/lib/url/escape.js");
--------------------------------------------------------------------^ 2| exports = module.exports =
require("…/…/…/css-loader/lib/css-base.js")(true); 3| // imports
4|expected “indent”, got “;”
这里应该是导饿了么css出了问题,解决办法
找到webpack.dev.conf.js文件,
其中有一行
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
},
usePostCSS把后面的true改成false就可以了
来源:oschina
链接:https://my.oschina.net/u/4256309/blog/4331865