Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'babel.config.js')
-rw-r--r--babel.config.js24
1 files changed, 3 insertions, 21 deletions
diff --git a/babel.config.js b/babel.config.js
index 39bb7858087..6838df3ad84 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -1,11 +1,11 @@
-const BABEL_ENV = process.env.BABEL_ENV || process.env.NODE_ENV || null;
+const coreJSVersion = require('./node_modules/core-js/package.json').version;
let presets = [
[
'@babel/preset-env',
{
useBuiltIns: 'usage',
- corejs: { version: 3, proposals: true },
+ corejs: { version: coreJSVersion, proposals: true },
modules: false,
},
],
@@ -13,7 +13,6 @@ let presets = [
// include stage 3 proposals
const plugins = [
- '@babel/plugin-syntax-import-meta',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-json-strings',
'@babel/plugin-proposal-private-methods',
@@ -26,26 +25,9 @@ const plugins = [
'lodash',
];
-// add code coverage tooling if necessary
-if (BABEL_ENV === 'coverage') {
- plugins.push([
- 'babel-plugin-istanbul',
- {
- exclude: ['app/assets/javascripts/locale/**/app.js'],
- },
- ]);
-}
-
-// Jest is running in node environment, so we need additional plugins
+// Jest is running in node environment
const isJest = Boolean(process.env.JEST_WORKER_ID);
if (isJest) {
- plugins.push('@babel/plugin-transform-modules-commonjs');
- /*
- without the following, babel-plugin-istanbul throws an error:
- https://gitlab.com/gitlab-org/gitlab-foss/issues/58390
- */
- plugins.push('babel-plugin-dynamic-import-node');
-
presets = [
[
'@babel/preset-env',