added autoprefixer, make css sourcemaps optional

This commit is contained in:
spalger 2015-07-21 23:12:11 -07:00
parent da9603a283
commit 89044bcd79
3 changed files with 10 additions and 4 deletions

View file

@ -45,6 +45,7 @@
"angular-nvd3": "panda01/angular-nvd3#kibana",
"ansicolors": "^0.3.2",
"auto-preload-rjscommon-deps-loader": "^1.0.1",
"autoprefixer": "^5.2.0",
"autoprefixer-loader": "^2.0.0",
"babel-jscs": "^1.0.3",
"base64-js": "0.0.8",

View file

@ -31,6 +31,8 @@ class BaseOptimizer extends EventEmitter {
}
getConfig() {
let mapQ = this.sourceMaps ? '?sourceMap' : '';
return {
context: fromRoot('.'),
entry: this.bundles.getEntriesConfig(),
@ -58,8 +60,8 @@ class BaseOptimizer extends EventEmitter {
module: {
loaders: [
{ test: /\.less$/, loader: ExtractTextPlugin.extract('style', 'css?sourceMap!less?sourceMap') },
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style', 'css?sourceMap') },
{ test: /\.less$/, loader: ExtractTextPlugin.extract('style', `css${mapQ}!autoprefixer!less${mapQ}`) },
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style', `css${mapQ}`) },
{ test: /\.jade$/, loader: 'jade' },
{ test: /\.(html|tmpl)$/, loader: 'raw' },
{ test: /\.png$/, loader: 'url?limit=2048!file?name=[path][name].[ext]' },

View file

@ -36,10 +36,13 @@ class UiApp {
getRelatedPlugins() {
var pluginsById = this.uiExports.kbnServer.plugins.byId;
return _.transform(this.getModules().require, function (plugins, id) {
return _.transform(this.getModules(), function (plugins, id) {
var matches = id.match(/^plugins\/([^\/]+)(?:\/|$)/);
if (!matches) return;
plugins.push(pluginsById[matches[1]]);
var plugin = pluginsById[matches[1]];
if (_.includes(plugins, plugin)) return;
plugins.push(plugin);
}, []);
}