Merge pull request #4690 from spalger/fix/chromeAndBundleExpectations

Misc. chrome and bundle tweaks
This commit is contained in:
Joe Fleming 2015-08-19 12:53:26 -05:00
commit 6ad85ea0de
5 changed files with 16 additions and 9 deletions

View file

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

View file

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

View file

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

View file

@ -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() }"

View file

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