vue -elementUI 运行报错error in ./node_modules/element-ui/lib/theme-chalk/index.css

项目用到了vue,elementUI,结合Webpack打包运行的时候报错

[email protected] 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
optimization

ERROR Failed to compile with 1 errors
10:32:34

error 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 “;”

vue -elementUI 运行报错error in ./node_modules/element-ui/lib/theme-chalk/index.css_第1张图片
这里应该是导饿了么css出了问题,解决办法

找到webpack.dev.conf.js文件,
其中有一行

module: {
    rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
  },

usePostCSS把后面的true改成false就可以了

你可能感兴趣的:(JavaScript,vue.js,node.js,javascript)