Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix babel "loose" warnings #587

Merged
merged 1 commit into from Jul 1, 2021
Merged

Fix babel "loose" warnings #587

merged 1 commit into from Jul 1, 2021

Conversation

mattbrictson
Copy link
Contributor

@mattbrictson mattbrictson commented Jun 25, 2021

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 suggested by webpacker:
rails/webpacker#3016

Steps to verify

  1. Check out the main branch.
  2. Delete node_modules and public/packs*.
  3. Run bin/setup.
  4. Run bin/webpack.
  5. You'll see lots of warnings.
  6. Check out this PR's branch.
  7. Repeat steps 2, 3, 4.
  8. You shouldn't see any warnings.

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
@mattbrictson mattbrictson merged commit 0da1932 into main Jul 1, 2021
@mattbrictson mattbrictson deleted the chores/fix-babel-warning branch July 1, 2021 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants