diff --git a/packages/kbn-optimizer/src/__fixtures__/mock_repo/src/core/public/entry_point.ts b/packages/kbn-optimizer/src/__fixtures__/mock_repo/src/core/public/entry_point.ts deleted file mode 100644 index 4101c6da343e69..00000000000000 --- a/packages/kbn-optimizer/src/__fixtures__/mock_repo/src/core/public/entry_point.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -// eslint-disable-next-line no-console -console.log(`core entry point`); diff --git a/packages/kbn-optimizer/src/worker/webpack.config.ts b/packages/kbn-optimizer/src/worker/webpack.config.ts index 2db2c5803a64e2..bb58bd0a3f0059 100644 --- a/packages/kbn-optimizer/src/worker/webpack.config.ts +++ b/packages/kbn-optimizer/src/worker/webpack.config.ts @@ -162,7 +162,7 @@ export function getWebpackConfig(bundle: Bundle, worker: WorkerConfig) { ], }, { - test: /\.(scss|css)$/, + test: /\.scss$/, exclude: /node_modules/, oneOf: [ { diff --git a/src/core/public/core.css b/src/core/public/_core.scss similarity index 100% rename from src/core/public/core.css rename to src/core/public/_core.scss diff --git a/src/core/public/core_system.ts b/src/core/public/core_system.ts index 9b3c4e32db5614..e58114b69dcc1e 100644 --- a/src/core/public/core_system.ts +++ b/src/core/public/core_system.ts @@ -17,8 +17,6 @@ * under the License. */ -import './core.css'; - import { CoreId } from '../server'; import { PackageInfo, EnvironmentMode } from '../server/types'; import { CoreSetup, CoreStart } from '.'; diff --git a/src/core/public/entry_point.ts b/src/core/public/entry_point.ts index c40fc5247d28c4..9461acccf30b9e 100644 --- a/src/core/public/entry_point.ts +++ b/src/core/public/entry_point.ts @@ -20,6 +20,9 @@ /** * This is the entry point used to boot the frontend when serving a application * that lives in the Kibana Platform. + * + * Any changes to this file should be kept in sync with + * src/legacy/ui/ui_bundles/app_entry_template.js */ import './index.scss'; diff --git a/src/core/public/index.scss b/src/core/public/index.scss index dc8dbc970452dc..4be46899cff67b 100644 --- a/src/core/public/index.scss +++ b/src/core/public/index.scss @@ -2,6 +2,7 @@ // import this explicitly @import '../../legacy/ui/public/styles/_styling_constants'; +@import './core'; @import './chrome/index'; @import './overlays/index'; @import './rendering/index'; diff --git a/src/legacy/ui/ui_bundles/app_entry_template.js b/src/legacy/ui/ui_bundles/app_entry_template.js index bf926c4a7b61d7..683fedd34316f2 100644 --- a/src/legacy/ui/ui_bundles/app_entry_template.js +++ b/src/legacy/ui/ui_bundles/app_entry_template.js @@ -25,6 +25,9 @@ export const appEntryTemplate = bundle => ` * * This is programmatically created and updated, do not modify * + * Any changes to this file should be kept in sync with + * src/core/public/entry_point.ts + * * context: ${bundle.getContext()} */ diff --git a/src/legacy/ui/ui_render/bootstrap/template.js.hbs b/src/legacy/ui/ui_render/bootstrap/template.js.hbs index ffabc6a33b61fb..7250fa4fc9ecae 100644 --- a/src/legacy/ui/ui_render/bootstrap/template.js.hbs +++ b/src/legacy/ui/ui_render/bootstrap/template.js.hbs @@ -69,12 +69,12 @@ if (window.__kbnStrictCsp__ && window.__kbnCspNotEnforced__) { } load([ - {{#each jsDependencies}} + {{#each jsDependencyPaths}} '{{this}}', {{/each}} ], function () { load([ - '{{entryBundle}}', + '{{entryBundlePath}}', {{#each styleSheetPaths}} '{{this}}', {{/each}} diff --git a/src/legacy/ui/ui_render/ui_render_mixin.js b/src/legacy/ui/ui_render/ui_render_mixin.js index 7821400fdc3077..1e84405dd51538 100644 --- a/src/legacy/ui/ui_render/ui_render_mixin.js +++ b/src/legacy/ui/ui_render/ui_render_mixin.js @@ -111,12 +111,13 @@ export function uiRenderMixin(kbnServer, server, config) { ? [ `${basePath}/bundles/kbn-ui-shared-deps/${UiSharedDeps.darkCssDistFilename}`, `${basePath}/node_modules/@kbn/ui-framework/dist/kui_dark.css`, + `${regularBundlePath}/dark_theme.style.css`, ] : [ `${basePath}/bundles/kbn-ui-shared-deps/${UiSharedDeps.lightCssDistFilename}`, `${basePath}/node_modules/@kbn/ui-framework/dist/kui_light.css`, + `${regularBundlePath}/light_theme.style.css`, ]), - `${regularBundlePath}/${darkMode ? 'dark' : 'light'}_theme.style.css`, `${regularBundlePath}/commons.style.css`, ...(isCore ? [] @@ -135,7 +136,7 @@ export function uiRenderMixin(kbnServer, server, config) { ]), ]; - const jsDependencies = [ + const jsDependencyPaths = [ ...UiSharedDeps.jsDepFilenames.map( filename => `${regularBundlePath}/kbn-ui-shared-deps/${filename}` ), @@ -155,9 +156,9 @@ export function uiRenderMixin(kbnServer, server, config) { const bootstrap = new AppBootstrap({ templateData: { darkMode, - jsDependencies, + jsDependencyPaths, styleSheetPaths, - entryBundle: isCore + entryBundlePath: isCore ? `${regularBundlePath}/core/core.entry.js` : `${regularBundlePath}/${app.getId()}.bundle.js`, },