vue使用webpack构建时的报错

错误如下:

No parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred.

解决:

方法一:升级:[email protected][email protected]或者更高

方法二:其实vue-loader的升级修改如下:

路径:node_modules/vue-loader/lib/template-compiler/index.js

    if (!isProduction) {
      code = prettier.format(code, { semi: false })
    }

    // 修改为:
    if (!isProduction) {
      code = prettier.format(code, { semi: false, parser: 'babel' })
    }

自己修改也能解决

猜你喜欢

转载自blog.csdn.net/khadijiah/article/details/99578275