Move babel config into separate file

This works better with the current eslint loader, as then eslint and
babel can look at the same configuration. See
<https://babeljs.io/docs/en/config-files>.

This is similar to .eslintrc.json.
This commit is contained in:
Martin Pitt 2021-04-09 08:06:00 +02:00 committed by Katerina Koukiou
parent 04d6c566c7
commit e449e94564
2 changed files with 15 additions and 20 deletions

14
.babelrc.json Normal file
View file

@ -0,0 +1,14 @@
{
"presets": [
["@babel/env", {
"targets": {
"chrome": "57",
"firefox": "52",
"safari": "10.3",
"edge": "16",
"opera": "44"
}
}],
"@babel/preset-react"
]
}

View file

@ -35,25 +35,6 @@ if (production) {
})); }));
} }
/* keep this in sync with cockpit.git */
const babel_loader = {
loader: "babel-loader",
options: {
presets: [
["@babel/env", {
"targets": {
"chrome": "57",
"firefox": "52",
"safari": "10.3",
"edge": "16",
"opera": "44"
}
}],
"@babel/preset-react"
]
}
}
/* check if sassc is available, to avoid unintelligible error messages */ /* check if sassc is available, to avoid unintelligible error messages */
try { try {
childProcess.execFileSync('sassc', ['--version'], { stdio: ['pipe', 'inherit', 'inherit'] }); childProcess.execFileSync('sassc', ['--version'], { stdio: ['pipe', 'inherit', 'inherit'] });
@ -100,7 +81,7 @@ module.exports = {
}, },
{ {
exclude: /node_modules/, exclude: /node_modules/,
use: babel_loader, use: "babel-loader",
test: /\.(js|jsx)$/ test: /\.(js|jsx)$/
}, },
/* HACK: remove unwanted fonts from PatternFly's css */ /* HACK: remove unwanted fonts from PatternFly's css */