且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在使用webpack进行编译时,Vue将HTML替换为注释

更新时间:2023-02-23 12:14:31

您正在运行没有模板编译器的仅运行时构建。

You are running a runtime-only build without the template compiler.

签出 https://vuejs.org/v2/guide/installation.html#Webpack

你需要为'vue'创建一个别名,所以webpack包含来自你node_modules /的正确的vue / dist / *。js:

You need to create an alias for 'vue', so webpack includes the correct vue/dist/*.js from your node_modules/:

module.exports = {
  // ...
  resolve: {
    alias: {
      'vue$': 'vue/dist/vue.esm.js'
    }
  }
}

另见 https://forum.vuejs.org/t/what-is-the-compiler-included-build/13239