Skip to content

Commit

Permalink
[kbn/ui-shared-deps] load base css file (#58520)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
Spencer and elasticmachine authored Feb 26, 2020
1 parent 8524303 commit 457783e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packages/kbn-ui-shared-deps/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export const distDir: string;
*/
export const distFilename: string;

/**
* Filename of the unthemed css file in the distributable directory
*/
export const baseCssDistFilename: string;

/**
* Filename of the dark-theme css file in the distributable directory
*/
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-ui-shared-deps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const Path = require('path');

exports.distDir = Path.resolve(__dirname, 'target');
exports.distFilename = 'kbn-ui-shared-deps.js';
exports.baseCssDistFilename = 'kbn-ui-shared-deps.css';
exports.lightCssDistFilename = 'kbn-ui-shared-deps.light.css';
exports.darkCssDistFilename = 'kbn-ui-shared-deps.dark.css';
exports.externals = {
Expand Down
7 changes: 5 additions & 2 deletions packages/kbn-ui-shared-deps/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ run(
});

compiler.hooks.watchRun.tap('report on start', () => {
process.stdout.cursorTo(0, 0);
process.stdout.clearScreenDown();
if (process.stdout.isTTY) {
process.stdout.cursorTo(0, 0);
process.stdout.clearScreenDown();
}

log.info('Running webpack compilation...');
});

Expand Down
1 change: 1 addition & 0 deletions src/legacy/ui/ui_render/ui_render_mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export function uiRenderMixin(kbnServer, server, config) {
);
const styleSheetPaths = [
...dllStyleChunks,
`${basePath}/bundles/kbn-ui-shared-deps/${UiSharedDeps.baseCssDistFilename}`,
...(darkMode
? [
`${basePath}/bundles/kbn-ui-shared-deps/${UiSharedDeps.darkCssDistFilename}`,
Expand Down
1 change: 1 addition & 0 deletions tasks/config/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ module.exports = function(grunt) {
? `http://localhost:5610/bundles/tests.bundle.js`
: `http://localhost:5610/bundles/tests.bundle.js?shards=${TOTAL_CI_SHARDS}&shard_num=${shardNum}`,

`http://localhost:5610/bundles/kbn-ui-shared-deps/${UiSharedDeps.baseCssDistFilename}`,
// this causes tilemap tests to fail, probably because the eui styles haven't been
// included in the karma harness a long some time, if ever
// `http://localhost:5610/bundles/kbn-ui-shared-deps/${UiSharedDeps.lightCssDistFilename}`,
Expand Down

0 comments on commit 457783e

Please sign in to comment.