Problems encountered in running vue files in webpack

Record the problems I encountered today. It took a long time to solve them, mainly because of version and reference problems.

To compile and run vue files in webpack, you have to install two plugins and reference a thing

Enter these two things in webpack.config.js

"vue-loader": "^15.4.2",
"vue-template-compiler": "^2.5.21"

Then execute the command npm install to install the plugin

Then add this rule in webpack.config.js

Then quote at the very top

const { VueLoaderPlugin } = require('vue-loader');

Then add this at the same level as the module

 ok that's all, you can run

Guess you like

Origin blog.csdn.net/rb0518/article/details/122494501