Skip to content

Commit

Permalink
Fixing Jest for Babel 7 in Plugins.
Browse files Browse the repository at this point in the history
Due to a change in Babel 7 that affects resolution of babel configs[1]
(`.babelrc` is now a hierarchical config, while `babel.config.js` is
not), source files outside of the source root of jest will not be
transpiled. That means, plugins running tests were not able to
require/import source files of core.

With this change, `.babelrc` will be renamed to `babel.config.js`, so it
is still used when a plugin imports a file from core.

[1]: jestjs/jest#6053 (comment)
  • Loading branch information
dennisoelkers committed Sep 25, 2018
1 parent 83a61de commit 9ec6c86
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6,632 deletions.
14 changes: 0 additions & 14 deletions graylog2-web-interface/.babelrc

This file was deleted.

13 changes: 13 additions & 0 deletions graylog2-web-interface/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
presets: ['@babel/env', '@babel/react', '@babel/flow'],
plugins: [
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-class-properties',
'add-module-exports',
],
env: {
test: {
plugins: ['babel-plugin-dynamic-import-node'],
},
},
};
Loading

0 comments on commit 9ec6c86

Please sign in to comment.