Add explicit loose configuration for babel plugins (#14048)
* Add explicit loose configuration for babel private-property plugin
Squelch this warning that happens a few dozen times during CI by
following the instructions:
Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-property-in-object since the "loose" mode option was set to "true" for @babel/plugin-proposal-private-methods.
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-property-in-object", { "loose": true }]
to the "plugins" section of your Babel config.
* Use spaces instead of tabs
This won't affect the test.
* Make all the other "implied loose" options loose, too.
This now squelches the warnings, and webpacker can compile without failing.
* Collect common option "loose: true" to preset env
Rather than 3 overrides to bring these inline, move to the shared options.
* Revert "Collect common option "loose: true" to preset env"
This reverts commit ca3d09ba6a47e03dbfb5f6108fcbc7f19b5a457b.
This commit is contained in:
parent
4d0b9c8ebf
commit
69a03c8b07
1 changed files with 13 additions and 0 deletions
|
|
@ -42,6 +42,7 @@ module.exports = function (api) {
|
|||
'@babel/plugin-proposal-class-properties',
|
||||
{
|
||||
spec: true,
|
||||
loose: true,
|
||||
},
|
||||
],
|
||||
[
|
||||
|
|
@ -50,6 +51,18 @@ module.exports = function (api) {
|
|||
useBuiltIns: true,
|
||||
},
|
||||
],
|
||||
[
|
||||
'@babel/plugin-proposal-private-property-in-object',
|
||||
{
|
||||
loose: true,
|
||||
}
|
||||
],
|
||||
[
|
||||
'@babel/plugin-proposal-private-methods',
|
||||
{
|
||||
loose: true,
|
||||
}
|
||||
],
|
||||
[
|
||||
'@babel/plugin-transform-react-jsx',
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue