mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -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 STATIC_BUNDLE_PLUGINS = [
|
||||
// { id: 'data', dirname: 'data' },
|
||||
{ id: 'data', dirname: 'data' },
|
||||
{ id: 'kibanaReact', dirname: 'kibana_react' },
|
||||
{ id: 'kibanaUtils', dirname: 'kibana_utils' },
|
||||
{ id: 'esUiShared', dirname: 'es_ui_shared' },
|
||||
|
@ -60,13 +60,8 @@ function dynamicExternals(bundle: Bundle, context: string, request: string) {
|
|||
return;
|
||||
}
|
||||
|
||||
// don't allow any static bundle to rely on other static bundles
|
||||
if (STATIC_BUNDLE_PLUGINS.some(p => bundle.id === p.id)) {
|
||||
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
|
||||
// ignore requests that don't include a /{dirname}/public for one of our
|
||||
// "static" bundles as a cheap way to avoid doing path resolution
|
||||
// for paths that couldn't possibly resolve to what we're looking for
|
||||
const reqToStaticBundle = STATIC_BUNDLE_PLUGINS.some(p =>
|
||||
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
|
||||
// public/index exports without considering topographic sorting by plugin deps (for now)
|
||||
'kibanaUtils',
|
||||
'esUiShared',
|
||||
'kibanaReact',
|
||||
'data',
|
||||
'esUiShared',
|
||||
...kbnServer.newPlatform.__internals.uiPlugins.public.keys()
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue