share single data plugin bundle (#64549)

This commit is contained in:
Spencer 2020-04-29 09:44:56 -07:00 committed by GitHub
parent 5082ff3252
commit 0d4cfba4b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 9 deletions

View file

@ -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`)

View file

@ -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()
);