mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Merge pull request #4690 from spalger/fix/chromeAndBundleExpectations
Misc. chrome and bundle tweaks
This commit is contained in:
commit
6ad85ea0de
5 changed files with 16 additions and 9 deletions
|
@ -11,6 +11,7 @@ var CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin');
|
|||
let utils = require('requirefrom')('src/utils');
|
||||
let fromRoot = utils('fromRoot');
|
||||
let babelOptions = require('./babelOptions');
|
||||
let babelExclude = [/[\/\\](node_modules|bower_components)[\/\\]/];
|
||||
|
||||
class BaseOptimizer {
|
||||
constructor(opts) {
|
||||
|
@ -111,16 +112,16 @@ class BaseOptimizer {
|
|||
{ test: /[\/\\]src[\/\\](plugins|ui)[\/\\].+\.js$/, loader: `rjs-repack${mapQ}` },
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /[\/\\](node_modules|bower_components)[\/\\]/,
|
||||
exclude: babelExclude.concat(this.env.noParse),
|
||||
loader: 'babel',
|
||||
query: babelOptions
|
||||
},
|
||||
{
|
||||
test: /\.jsx$/,
|
||||
exclude: /[\/\\](node_modules|bower_components)[\/\\]/,
|
||||
exclude: babelExclude.concat(this.env.noParse),
|
||||
loader: 'babel',
|
||||
query: defaults({
|
||||
nonStandard: true
|
||||
nonStandard: true,
|
||||
}, babelOptions)
|
||||
}
|
||||
].concat(this.env.loaders),
|
||||
|
|
|
@ -28,13 +28,13 @@ class UiApp {
|
|||
}
|
||||
|
||||
getModules() {
|
||||
return _([
|
||||
return _.chain([
|
||||
this.autoloadOverrides || autoload.require,
|
||||
this.uiExports.find(_.get(this, 'spec.uses', [])),
|
||||
])
|
||||
.flatten()
|
||||
.uniq()
|
||||
.push(this.main)
|
||||
.unshift(this.main)
|
||||
.value();
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,14 @@ let fromRoot = require('../utils/fromRoot');
|
|||
let asRegExp = flow(
|
||||
escapeRegExp,
|
||||
function (path) {
|
||||
return path + '(?:\\.js)?$';
|
||||
let last = path.slice(-1);
|
||||
if (last === '/' || last === '\\') {
|
||||
// match a directory explicitly
|
||||
return path + '.*';
|
||||
} else {
|
||||
// match a directory or files or just the absolute path
|
||||
return path + '(?:\\.js$|$|\\\\|\\/)?';
|
||||
}
|
||||
},
|
||||
RegExp
|
||||
);
|
||||
|
@ -129,7 +136,7 @@ module.exports = class UiBundlerEnv {
|
|||
if (exports) loader.push(`exports?${exports}`);
|
||||
if (expose) loader.push(`expose?${expose}`);
|
||||
if (loader.length) this.loaders.push({ test: asRegExp(path), loader: loader.join('!') });
|
||||
if (!parse) this.noParse.push(asRegExp(path));
|
||||
if (!parse) this.addNoParse(path);
|
||||
}
|
||||
|
||||
claim(id, pluginId) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<kbn-notifications list="notifList"></kbn-notifications>
|
||||
<div class="content" style="display: none;" chrome-context >
|
||||
<div class="content" chrome-context >
|
||||
<nav
|
||||
ng-style="{ background: chrome.getNavBackground() }"
|
||||
ng-class="{ show: chrome.getVisible() }"
|
||||
|
|
|
@ -42,7 +42,6 @@ require('./api/theme')(chrome, internals);
|
|||
chrome.bootstrap = function () {
|
||||
chrome.setupAngular();
|
||||
angular.bootstrap(document, ['kibana']);
|
||||
$(document.body).children(':not(style-compile)').show();
|
||||
};
|
||||
|
||||
module.exports = chrome;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue