zoukankan      html  css  js  c++  java
  • Nuxt报错:Though the "loose" option was set to "false" in your @babel/preset-env config, it will not的问题解决

    一、问题情况

      nuxt 执行报错 :

    WARN  Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-methods since the "loose" mode option was set to "true" for @babel/plugin-proposal-class-properties.
    The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding ["@babel/plugin-proposal-private-methods", { "loose": true }] to the "plugins" section of your Babel config

      一直疯狂的报这个警告,不知道什么原因。

    二、问题解决

      遇到这情况,在 nuxt.config.js 的 build 加上该插件就行了,注意位置,别放错地方了

    build: {
        parallel: true,
        babel:{
          plugins:[
            ["@babel/plugin-proposal-private-methods", { "loose": true }]
          ]
       }
    }

      加上这个配置即可。

  • 相关阅读:
    Java中返回参数值的几种状态
    Java中的二维数组
    Java foreach操作(遍历)数组
    Arrays 类操作 Java 的数组排序
    Java循环语句 for
    Java循环语句 while
    Java条件语句 switch case
    Java多重if....else if
    margin优化的一种思路
    5.命名规则
  • 原文地址:https://www.cnblogs.com/goloving/p/14919604.html
Copyright © 2011-2022 走看看