[utils/babelRegister] add support for changes in elastic/kibana#13973

Original commit: elastic/kibana-plugin-helpers@13f30fb4d5
This commit is contained in:
spalger 2017-09-19 16:37:25 -07:00
parent ea8aa196b0
commit 15ee7c7a01
2 changed files with 11 additions and 3222 deletions

View file

@ -4,7 +4,17 @@ const pluginConfig = require('./plugin_config');
function babelRegister() {
const plugin = pluginConfig();
require(resolve(plugin.kibanaRoot, 'src/optimize/babel/register'));
try {
// add support for moved babel-register source: https://github.com/elastic/kibana/pull/13973
require(resolve(plugin.kibanaRoot, 'src/babel-register'));
} catch (error) {
if (error.code === 'MODULE_NOT_FOUND') {
require(resolve(plugin.kibanaRoot, 'src/optimize/babel/register'));
} else {
throw error;
}
}
}
function resolveKibanaPath(path) {

File diff suppressed because it is too large Load diff