Webpack uses vue-loader, but does not recognize .vue.

there is a problem of not recognizing the attribute vue for beginners of vue and webpack,.
I have added {test:/.vue$/,use:"vue-loader"}
to rules and also installed vueloader and vue-template-compiler
with a warning and an error, as shown in the following figure

Mar.11,2021

how thenew.vue is written. Beginners suggest using vue-cli to build a project


1. The warning is because after webpack is updated to 4, you need to set the value of mode . The value of mode can be development or production , similar to "build": "webpack-- mode production" setting
2. If you make an error, post the thenew.vue code


that you may not have introduced vue,. Add import Vue from 'vue' to the index.js.

Menu