Skip to content

Commit

Permalink
Fix babel "loose" warnings
Browse files Browse the repository at this point in the history
This fixes the following warnings emitted by webpack:

```
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.
```

This matches the new default babel config generated by webpacker:
rails/webpacker#3016
  • Loading branch information
mattbrictson committed Jun 25, 2021
1 parent 40af979 commit d906098
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions babel.config.js
Expand Up @@ -47,6 +47,12 @@ module.exports = function(api) {
loose: true
}
],
[
require('@babel/plugin-proposal-private-methods').default,
{
loose: true
}
],
[
require('@babel/plugin-proposal-object-rest-spread').default,
{
Expand Down

0 comments on commit d906098

Please sign in to comment.