webpack4.0 vue 打包 报错 These relative modules were not found:

新手上路,请多包涵

webpack4.0 vue 打包 报错 These relative modules were not found:

各种依赖都升级后还是报错

Failed to compile with 13 errors                                                                          10:04:45

These relative modules were not found:

* ./button.vue?vue&type=style&index=0&id=c6f153ca&lang=scss&scoped=true& in ./src/components/common/button/button.vue
* ./assets/style/reset.css in ./src/main.js
* ./demo.vue?vue&type=style&index=0&id=6286b906&lang=scss&scoped=true& in ./src/views/demo.vue
* ./App.vue?vue&type=style&index=0&lang=scss& in ./src/App.vue
* ./debug.vue?vue&type=style&index=0&id=5621ebfa&lang=scss&scoped=true& in ./src/components/common/debug/debug.vue
* ./index.vue?vue&type=style&index=0&id=791ac323&lang=scss&scoped=true& in ./src/components/common/share/src/index.vue
* ./Home.vue?vue&type=style&index=0&lang=scss& in ./src/views/Home.vue
* ./cell.vue?vue&type=style&index=0&lang=scss& in ./src/components/common/list/cell.vue
* ./loading.vue?vue&type=style&index=0&id=633762d5&lang=scss&scoped=true& in ./src/components/common/loading/loading.vue
* ./list.vue?vue&type=style&index=0&lang=scss& in ./src/components/common/list/list.vue
* ./index.vue?vue&type=style&index=0&id=70435e80&lang=scss&scoped=true& in ./src/components/common/app-header/index.vue
* ./toast.vue?vue&type=style&index=0&lang=scss& in ./src/components/common/toast/src/toast.vue
* ./message-box.vue?vue&type=style&index=0&lang=scss& in ./src/components/common/message-box/src/message-box.vue

最后在解析样式loader里加了 include:[]不报错了

    {
      test: /\.(css|scss|sass)$/,
      include:[],
      loader: ['style-loader', 'css-loader', 'sass-loader', 'postcss-loader']
    }

不知道是什么原因,是不是因为某些依赖包没有升级好?

阅读 5.4k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏