Remove function binding usage
Some checks failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/tests Pipeline failed

This commit is contained in:
Sonny Bakker 2025-02-08 10:05:45 +01:00
parent 34afcc02b6
commit 1a54fdbcd1
6 changed files with 21 additions and 35 deletions

View file

@ -1,23 +1,21 @@
module.exports = api => {
const isTest = api.env('test');
const preset = [
"@babel/preset-env" , { targets: 'defaults' }
const preset = [
"@babel/preset-env", { targets: 'defaults' }
];
const testPreset = [
"@babel/preset-env", { targets: { node: process.versions.node } }
];
const testPreset = [
"@babel/preset-env", { targets: { node: process.versions.node } }
];
const plugins = [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-react-jsx",
"@babel/plugin-syntax-function-bind",
"@babel/plugin-proposal-function-bind",
"@babel/plugin-proposal-class-properties"
]
const plugins = [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-react-jsx",
"@babel/plugin-proposal-class-properties"
]
return {
"presets": [isTest ? testPreset: preset],
"plugins": plugins
}
return {
"presets": [isTest ? testPreset : preset],
"plugins": plugins
}
}