diff --git a/buildtools/webpack.api.js b/buildtools/webpack.api.js index e3ff082c3cfd..6cbc28aa5648 100644 --- a/buildtools/webpack.api.js +++ b/buildtools/webpack.api.js @@ -1,6 +1,6 @@ // The MIT License (MIT) // -// Copyright (c) 2018-2022 Camptocamp SA +// Copyright (c) 2018-2023 Camptocamp SA // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in @@ -39,6 +39,10 @@ module.exports = (env, argv) => { options: { babelrc: false, comments: false, + plugins: [ + require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'), + require.resolve('@babel/plugin-proposal-optional-chaining'), + ], }, }, }, diff --git a/buildtools/webpack.commons.js b/buildtools/webpack.commons.js index 1e842a5fa35e..47408cb53a2f 100644 --- a/buildtools/webpack.commons.js +++ b/buildtools/webpack.commons.js @@ -1,6 +1,6 @@ // The MIT License (MIT) // -// Copyright (c) 2017-2022 Camptocamp SA +// Copyright (c) 2017-2023 Camptocamp SA // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in @@ -151,7 +151,9 @@ module.exports = function (config) { {allowDeclareFields: true}, ], [require.resolve('@babel/plugin-proposal-decorators'), {decoratorsBeforeExport: true}], - [require.resolve('@babel/plugin-proposal-class-properties')], + require.resolve('@babel/plugin-proposal-class-properties'), + require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'), + require.resolve('@babel/plugin-proposal-optional-chaining'), ], }, }, @@ -171,7 +173,11 @@ module.exports = function (config) { options: { babelrc: false, comments: false, - plugins: [require.resolve('babel-plugin-angularjs-annotate')], + plugins: [ + require.resolve('babel-plugin-angularjs-annotate'), + require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'), + require.resolve('@babel/plugin-proposal-optional-chaining'), + ], }, }, }; @@ -194,6 +200,10 @@ module.exports = function (config) { options: { babelrc: false, comments: false, + plugins: [ + require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'), + require.resolve('@babel/plugin-proposal-optional-chaining'), + ], }, }, }; diff --git a/buildtools/webpack.config.dll.js b/buildtools/webpack.config.dll.js index 4acacde46df4..10283f2e8d4b 100644 --- a/buildtools/webpack.config.dll.js +++ b/buildtools/webpack.config.dll.js @@ -1,6 +1,6 @@ // The MIT License (MIT) // -// Copyright (c) 2019-2022 Camptocamp SA +// Copyright (c) 2019-2023 Camptocamp SA // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in @@ -41,6 +41,10 @@ module.exports = { options: { babelrc: false, comments: false, + plugins: [ + require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'), + require.resolve('@babel/plugin-proposal-optional-chaining'), + ], }, }, }, diff --git a/package.json b/package.json index e74eede1dc55..a169c1e231c1 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,8 @@ }, "devDependencies": { "@babel/core": "7.22.9", + "@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6", + "@babel/plugin-proposal-optional-chaining": "7.21.0", "@babel/plugin-proposal-class-properties": "7.18.6", "@babel/plugin-proposal-decorators": "7.22.7", "@babel/plugin-syntax-object-rest-spread": "7.8.3",