mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[babel-register] ignore packages directory when running from source (#26098)
When running the Kibana distributable packages are excluded from `babel-register` because they are installed in the node_modules directory. When running from source they are not ignored, which means that babel-register is doing more work than necessary because these files need to already be built. To fix this I've added an ignore rule that excludes all packages when we are running from source.
This commit is contained in:
parent
f981cdf4cc
commit
4b0893ac6e
1 changed files with 8 additions and 1 deletions
|
@ -42,7 +42,7 @@ var ignore = [
|
|||
/\/node_modules\/(?!x-pack\/(?!node_modules)([^\/]+))([^\/]+\/[^\/]+)/,
|
||||
|
||||
// ignore paths matching `/canvas/canvas_plugin/{a}/{b}` unless
|
||||
// is `x-pack` and `b` is not `node_modules`
|
||||
// `a` is `functions` and `b` is `server`
|
||||
/\/canvas\/canvas_plugin\/(?!functions\/server)([^\/]+\/[^\/]+)/,
|
||||
];
|
||||
|
||||
|
@ -56,6 +56,13 @@ if (global.__BUILT_WITH_BABEL__) {
|
|||
// building their server code at require-time since version 4.2
|
||||
// TODO: the plugin install process could transpile plugin server code...
|
||||
ignore.push(resolve(__dirname, '../../../src'));
|
||||
} else {
|
||||
ignore.push(
|
||||
// ignore any path in the packages, unless it is in the package's
|
||||
// root `src` directory, in any test or __tests__ directory, or it
|
||||
// ends with .test.js, .test.ts, or .test.tsx
|
||||
/\/packages\/(eslint-|kbn-)[^\/]+\/(?!src\/.*|(.+\/)?(test|__tests__)\/.+|.+\.test\.(js|ts|tsx)$)(.+$)/
|
||||
);
|
||||
}
|
||||
|
||||
// modifies all future calls to require() to automatically
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue