diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2019-02-20 23:27:23 +0300 |
---|---|---|
committer | Winnie Hellmann <winnie@gitlab.com> | 2019-02-21 13:02:32 +0300 |
commit | dc9a67652d77a56038d3132aab1856e555e4c769 (patch) | |
tree | 4f6723bea60aec03c3bbbb03e9306eb9603ead45 /.babelrc.js | |
parent | 8d74aab4289fb7a050e0163bf1affa9e62bb079e (diff) |
Transpile @gitlab/ui for Jest
Diffstat (limited to '.babelrc.js')
-rw-r--r-- | .babelrc.js | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/.babelrc.js b/.babelrc.js deleted file mode 100644 index 1b05a67354e..00000000000 --- a/.babelrc.js +++ /dev/null @@ -1,45 +0,0 @@ -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('transform-es2015-modules-commonjs'); - plugins.push('dynamic-import-node'); -} - -module.exports = { presets, plugins }; |