mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
fix(babel): loose option for babel class-properties and private-methods (#9232)
This commit is contained in:
parent
65e62b96a3
commit
1e249cc290
@ -18,6 +18,7 @@
|
||||
"@babel/plugin-proposal-decorators": "^7.13.15",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.13.8",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.13.12",
|
||||
"@babel/plugin-proposal-private-methods": "^7.13.0",
|
||||
"@babel/plugin-transform-runtime": "^7.13.15",
|
||||
"@babel/preset-env": "^7.14.0",
|
||||
"@babel/runtime": "^7.14.0",
|
||||
|
@ -135,7 +135,15 @@ module.exports = (api, options = {}) => {
|
||||
ignoreBrowserslistConfig,
|
||||
configPath,
|
||||
include,
|
||||
exclude: polyfills.concat(exclude || []),
|
||||
exclude: [
|
||||
...exclude || [],
|
||||
...polyfills,
|
||||
// Although preset-env includes class-properties
|
||||
// but webpack 4 doesn't support the syntax when target supports and babel transpilation is skipped
|
||||
// https://github.com/webpack/webpack/issues/9708
|
||||
'@babel/plugin-proposal-class-properties',
|
||||
'@babel/plugin-proposal-private-methods'
|
||||
],
|
||||
shippedProposals,
|
||||
forceAllTransforms
|
||||
}
|
||||
@ -151,7 +159,9 @@ module.exports = (api, options = {}) => {
|
||||
decoratorsBeforeExport,
|
||||
legacy: decoratorsLegacy !== false
|
||||
}],
|
||||
[require('@babel/plugin-proposal-class-properties'), { loose: true }]
|
||||
// class-properties and private-methods need same loose value
|
||||
[require('@babel/plugin-proposal-class-properties'), { loose: true }],
|
||||
[require('@babel/plugin-proposal-private-methods'), { loose: true }]
|
||||
)
|
||||
|
||||
// Transform runtime, but only for helpers
|
||||
|
Loading…
Reference in New Issue
Block a user