关于 vue 项目 run dev 的时候,控制台警告:javascript
No parser and no filepath given, using 'babylon' the parser now but this will throw an error in the future. Please specify a parser or a file path so one can be inferred.vue
这个通常是配置问题,是vue-loader的问题。java
不过有的说是 安装 prettier 依赖,来控制代码格式,好像没用。node
其实有个简单的方法就是修改一下js文件:this
去文件夹:code
node_modules\vue-loader\lib\template-compiler\index.js
下进行修改:orm
if (!isProduction) { code = prettier.format(code, { semi: false}) }
修改为:blog
if (!isProduction) { code = prettier.format(code, { semi: false, parser: 'babylon' }) }
OK,去从新run 一下ip