Though the "loose" option was set to "false" in your @babel/preset-env

2021-05-08 17:18:22

问题 :

I have a fresh install of nuxt version 2.14.6 and I would like to silence an error I get when I run the nuxt command:

 WARN  Though the "loose" option was set to "false" in your @babel/preset-env co
The "loose" option must be the same for @babel/plugin-proposal-class-properties,
        ["@babel/plugin-proposal-private-methods", { "loose": true }]
to the "plugins" section of your Babel config.

I'm assuming I need to override the babel config in my nuxt.config.js file, but I haven't found any helpful solutions.

Thanks in advance for your help!


解决办法:


Add the following to your nuxt.config.js file under the build section.

nuxt.config.js

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


  • 2018-01-29 15:18:57

    Druid多数据源配置

    搞了一天,竟然输在了把datasource,携程dataSource.老是切换不成功,几近崩溃。

  • 2018-02-01 22:09:18

    给linux添加回收站

    linux下常常使用rm,导致误操作删除一些重要的文档,很难恢复(当然也能恢复,不过比较复杂),所以在这种情况下,我们如果能给linux添加一个回收站就好多了,说白了,这个回收站机制也比较简单,就是使用 mv封装一个rm,简单的可以自己写个脚本,复杂点的就是在bin下添加这个封装命令就行了。