• 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 s
    ilence this warning by explicitly adding
            ["@babel/plugin-proposal-private-methods", { "loose": true }]
    to the "plugins" section of your Babel config.


     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 s
    ilence this warning by explicitly adding
            ["@babel/plugin-proposal-private-methods", { "loose": true }]
    to the "plugins" section of your Babel config.
     

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

    nuxt.config.js 里

      // Build Configuration: https://go.nuxtjs.dev/config-build
      build: {
        babel:{
           plugins:[
             ["@babel/plugin-proposal-private-methods", { "loose": true }]
           ]
        }
      }

    即可

  • 相关阅读:
    base64加密/解密
    js split 的用法和定义 js split分割字符串成数组的实例代码
    js获取html5 audio 音频时长方法
    获取虾米音乐的歌词
    ajax请求QQ音乐
    MarkdownPad2.5 注册码
    neovim 使用
    tmux的使用方法和个性化配置
    linux 安装libevent
    boost.sha1
  • 原文地址:https://www.cnblogs.com/lllomh/p/14991862.html
Copyright © 2020-2023  润新知