Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
[utils/babelRegister] add support for changes in elastic/kibana#13973
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Sep 19, 2017
1 parent 22bc67e commit 13f30fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3,222 deletions.
12 changes: 11 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading

0 comments on commit 13f30fb

Please sign in to comment.