Solve the webpack+vue project error "You are using the runtime-only build of Vue where the template compiler is not av"

As the title, solve the webpack+vue project error "You are using the runtime-only build of Vue where the template compiler is not available"

The solution is to add a vue alias in the red box as shown below, and directly introduce vue/dist/vue.esm.js:

Paste the code, attached picture:

    resolve:{
      extensions: ['.js', '.json', '.vue'], //扩展名省略配置
      alias:{
        //模块别名
        vue: "vue/dist/vue.esm.js", //加上这一句
        '@':resolve('src'),
      }
    },

Guess you like

Origin blog.csdn.net/taozi550185271/article/details/109183647