mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
share single data plugin bundle (#64549)
This commit is contained in:
parent
5082ff3252
commit
0d4cfba4b4
2 changed files with 5 additions and 9 deletions
|
@ -37,7 +37,7 @@ const ISTANBUL_PRESET_PATH = require.resolve('@kbn/babel-preset/istanbul_preset'
|
||||||
const BABEL_PRESET_PATH = require.resolve('@kbn/babel-preset/webpack_preset');
|
const BABEL_PRESET_PATH = require.resolve('@kbn/babel-preset/webpack_preset');
|
||||||
|
|
||||||
const STATIC_BUNDLE_PLUGINS = [
|
const STATIC_BUNDLE_PLUGINS = [
|
||||||
// { id: 'data', dirname: 'data' },
|
{ id: 'data', dirname: 'data' },
|
||||||
{ id: 'kibanaReact', dirname: 'kibana_react' },
|
{ id: 'kibanaReact', dirname: 'kibana_react' },
|
||||||
{ id: 'kibanaUtils', dirname: 'kibana_utils' },
|
{ id: 'kibanaUtils', dirname: 'kibana_utils' },
|
||||||
{ id: 'esUiShared', dirname: 'es_ui_shared' },
|
{ id: 'esUiShared', dirname: 'es_ui_shared' },
|
||||||
|
@ -60,13 +60,8 @@ function dynamicExternals(bundle: Bundle, context: string, request: string) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't allow any static bundle to rely on other static bundles
|
// ignore requests that don't include a /{dirname}/public for one of our
|
||||||
if (STATIC_BUNDLE_PLUGINS.some(p => bundle.id === p.id)) {
|
// "static" bundles as a cheap way to avoid doing path resolution
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ignore requests that don't include a /data/public, /kibana_react/public, or
|
|
||||||
// /kibana_utils/public segment as a cheap way to avoid doing path resolution
|
|
||||||
// for paths that couldn't possibly resolve to what we're looking for
|
// for paths that couldn't possibly resolve to what we're looking for
|
||||||
const reqToStaticBundle = STATIC_BUNDLE_PLUGINS.some(p =>
|
const reqToStaticBundle = STATIC_BUNDLE_PLUGINS.some(p =>
|
||||||
request.includes(`/${p.dirname}/public`)
|
request.includes(`/${p.dirname}/public`)
|
||||||
|
|
|
@ -145,8 +145,9 @@ export function uiRenderMixin(kbnServer, server, config) {
|
||||||
// load these plugins first, they are "shared" and other bundles access their
|
// load these plugins first, they are "shared" and other bundles access their
|
||||||
// public/index exports without considering topographic sorting by plugin deps (for now)
|
// public/index exports without considering topographic sorting by plugin deps (for now)
|
||||||
'kibanaUtils',
|
'kibanaUtils',
|
||||||
'esUiShared',
|
|
||||||
'kibanaReact',
|
'kibanaReact',
|
||||||
|
'data',
|
||||||
|
'esUiShared',
|
||||||
...kbnServer.newPlatform.__internals.uiPlugins.public.keys()
|
...kbnServer.newPlatform.__internals.uiPlugins.public.keys()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue