webpack 创建的vue项目复制到另一文件夹后报错 ,找不到import引入的css

错误内容

error  in ./node_modules/element-ui/lib/theme-chalk/index.css
Module build failed: Error: No PostCSS Config found in: /Users/wyx/2020work/schoolSafeMgr2020/schoolSafeMgrWeb/views/web_dv_vue/node_modules/element-ui/lib/theme-chalk
    at /Users/wyx/2020work/schoolSafeMgr2020/schoolSafeMgrWeb/views/web_dv_vue/node_modules/postcss-load-config/src/index.js:91:15

 @ ./node_modules/element-ui/lib/theme-chalk/index.css 4:14-124 13:3-17:5 14:22-132
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server ./src/main.js


解决办法


image.png

创建文件 postcss.config.js

文件内容:

module.exports = {
    plugins: {
        'autoprefixer': {browsers: 'last 5 version'}
    }
}

然后在重启就好

$ npm install 
$ npm run dev

你可能感兴趣的:(webpack 创建的vue项目复制到另一文件夹后报错 ,找不到import引入的css)