summaryrefslogtreecommitdiff
path: root/babel.config.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-20 11:10:13 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-20 11:10:13 +0000
commit0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch)
tree7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /babel.config.js
parent72123183a20411a36d607d70b12d57c484394c8e (diff)
downloadgitlab-ce-0ea3fcec397b69815975647f5e2aa5fe944a8486.tar.gz
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
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',