From e449e945646ec673b84f8375f486645864b79664 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 9 Apr 2021 08:06:00 +0200 Subject: [PATCH] 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 . This is similar to .eslintrc.json. --- .babelrc.json | 14 ++++++++++++++ webpack.config.js | 21 +-------------------- 2 files changed, 15 insertions(+), 20 deletions(-) create mode 100644 .babelrc.json diff --git a/.babelrc.json b/.babelrc.json new file mode 100644 index 0000000..dfe57f2 --- /dev/null +++ b/.babelrc.json @@ -0,0 +1,14 @@ +{ + "presets": [ + ["@babel/env", { + "targets": { + "chrome": "57", + "firefox": "52", + "safari": "10.3", + "edge": "16", + "opera": "44" + } + }], + "@babel/preset-react" + ] +} diff --git a/webpack.config.js b/webpack.config.js index f02c0b9..00295cb 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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 */ try { childProcess.execFileSync('sassc', ['--version'], { stdio: ['pipe', 'inherit', 'inherit'] }); @@ -100,7 +81,7 @@ module.exports = { }, { exclude: /node_modules/, - use: babel_loader, + use: "babel-loader", test: /\.(js|jsx)$/ }, /* HACK: remove unwanted fonts from PatternFly's css */