webpacker babel 垃圾邮件删除消息不够清楚

webpacker babel spam removal message not clear enough

将 webpacker 与 rails 一起使用,编译过程被 babel

中更改的配置问题所淹没

虽然 this solution of adding a resolutions blockpackage.json 文件,+ 对最新版本的更新,摆脱了这些消息的 tom,还有一些

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.

没有太大帮助。搜索 config 会显示 76 个项目,其中 2 个目录具有该名称,4 个 .js 字段名称中具有该字符串。在 babel 子目录 plugin-proposal-class-properties 中没有配置文件,建议的字符串不是 json 格式,因此不会进入该 su 目录的 package.json 文件

那么我们到底在哪里设置呢?

babel.config.js 中,在 plugins 数组中,只需将其添加为最后一项:

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