vue.js 新建项目报错
[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.
最近打算从零开始写一个项目,发现刚安装完 vue 之后,运行之后报错
网上相关帖子很多,解释的也很清楚,
在这里就只记录下解决的方法。
在 webpack.config.js
文件中增加一下配置,
目的是利用 webpack
的重命名功能,重新规定引入 vue .js 的路径
resolve: {
alias: {
'vue$': 'vue/dist/vue.js'
}
}