diff --git a/debian/patches/0720-use-babelrc.js-tmp.patch b/debian/patches/0720-use-babelrc.js-tmp.patch new file mode 100644 index 0000000000..d3568705ab --- /dev/null +++ b/debian/patches/0720-use-babelrc.js-tmp.patch @@ -0,0 +1,58 @@ +Description: Using .babelrc.js out of babel.config.js for a temporary + period of time :) +Author: Utkarsh Gupta + +--- /dev/null ++++ gitlab-11.10.4+dfsg/.babelrc.js +@@ -0,0 +1,51 @@ ++/* eslint-disable import/no-commonjs, filenames/match-regex */ ++ ++const BABEL_ENV = process.env.BABEL_ENV || process.env.NODE_ENV || null; ++ ++const presets = [ ++ [ ++ '@babel/preset-env', ++ { ++ modules: false, ++ targets: { ++ ie: '11', ++ }, ++ }, ++ ], ++]; ++ ++// include stage 3 proposals ++const plugins = [ ++ '@babel/plugin-syntax-dynamic-import', ++ '@babel/plugin-syntax-import-meta', ++ '@babel/plugin-proposal-class-properties', ++ '@babel/plugin-proposal-json-strings', ++ '@babel/plugin-proposal-private-methods', ++]; ++ ++// add code coverage tooling if necessary ++if (BABEL_ENV === 'coverage') { ++ plugins.push([ ++ 'babel-plugin-istanbul', ++ { ++ exclude: ['spec/javascripts/**/*', 'app/assets/javascripts/locale/**/app.js'], ++ }, ++ ]); ++} ++ ++// add rewire support when running tests ++if (BABEL_ENV === 'karma' || BABEL_ENV === 'coverage') { ++ plugins.push('babel-plugin-rewire'); ++} ++ ++// Jest is running in node environment ++if (BABEL_ENV === 'jest') { ++ plugins.push('@babel/plugin-transform-modules-commonjs'); ++ /* ++ without the following, babel-plugin-istanbul throws an error: ++ https://gitlab.com/gitlab-org/gitlab-ce/issues/58390 ++ */ ++ plugins.push('babel-plugin-dynamic-import-node'); ++} ++ ++module.exports = { presets, plugins }; diff --git a/debian/patches/series b/debian/patches/series index dfcd7020d0..61f1c02db5 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -31,3 +31,4 @@ 0690-debian-usage-ping.patch 0700-add-salsa-link-to-help.patch 0710-use-yarnpkg.patch +0720-use-babelrc.js-tmp.patch