Merge pull request #132 from ccowan/master

Path changes and reconfiguration for build
This commit is contained in:
Chris Cowan 2014-03-08 10:42:08 -07:00
commit d08a184d32
10 changed files with 37 additions and 11 deletions

View file

@ -1,6 +1,6 @@
define(function (require) {
'use strict';
var config = require('/kibana/config.js');
var config = require('config');
var loaded = false;
window.GoogleAnalyticsObject = 'ga';
@ -16,7 +16,9 @@ define(function (require) {
// create the async tag and inject it into the page.
function load () {
if (loaded) return;
if (loaded) {
return void 0;
}
var asyncTag = document.createElement('script');
var firstScript = document.getElementsByTagName('script')[0];
asyncTag.async = 1;

View file

@ -3,7 +3,7 @@
* config.js is where you will find the core Kibana configuration. This file contains parameter that
* must be set before kibana is run for the first time.
*/
define(['/kibana/app/components/settings.js'],
define(['settings'],
function (Settings) {
"use strict";

View file

@ -14,7 +14,7 @@ define([
'app',
'kbn',
'lodash',
'/common/analytics.js',
'../../../../../common/analytics',
'factories/store'
],
function (angular, app, kbn, _, ga) {
@ -138,7 +138,9 @@ function (angular, app, kbn, _, ga) {
$scope.setOptIn = function(val) {
marvelOpts.version = kbnVersion;
marvelOpts.report = val;
if (val) ga.pageview();
if (val) {
ga.pageview();
}
};
$scope.clearMarvelStorage = function() {

View file

@ -16,7 +16,7 @@ define([
'app',
'jquery',
'lodash',
'/common/analytics.js',
'../../../../../common/analytics',
'factories/store'
],
function (angular, app, $, _, ga) {

View file

@ -3,7 +3,7 @@ define([
'sense_editor/editor',
'jquery',
'moment',
'settings'
'sense_settings'
], function (_, SenseEditor, $, moment) {
'use strict';

View file

@ -5,7 +5,7 @@ define([
'mappings',
'output',
'sense_editor/editor',
'settings',
'sense_settings',
'require',
'utils',
'zeroclip',

View file

@ -1,6 +1,6 @@
define([
'ace',
'settings',
'sense_settings',
'jquery'
], function (ace, settings, $) {
'use strict';

View file

@ -17,8 +17,12 @@
'ace_mode_json': '../vendor/ace/mode-json',
'ace_ext_language_tools': '../vendor/ace/ext-language_tools',
'ace_ext_searchbox': '../vendor/ace/ext-searchbox',
'analytics': '/common/analytics',
'lodash': '/kibana/vendor/lodash'
// Adding config for the kibana dependencies
'config': '../../kibana/config',
'settings': '../../kibana/app/components/settings',
'sense_settings': './settings',
'analytics': '../../common/analytics',
'lodash': '../../kibana/vendor/lodash'
},
map: {
'*': {

View file

@ -42,6 +42,13 @@ module.exports = function (config) {
cwd: 'kibana/panels',
src: '**',
dest: '<%= buildTempDir %>/src/app/panels/marvel'
},
// Copy the common/analyitcs.js in for the build
{
cwd: '.',
expand: true,
src: ['./common/**/*.js'],
dest: '<%= buildTempDir %>'
}
]
}

View file

@ -20,6 +20,17 @@ module.exports = function (grunt) {
],
mainConfigFile: '<%= senseDir %>/app/require.config.js',
/**
Inject the Kibana config, settings and lodash so that the shared
analytics.js file will function properly. Since the build enviroment
doesn't match the runtime enviroment because of how everything is patched
together we need to do this injection to get things to build properly.
**/
paths: {
'config': __dirname+'/../../build/tmp/src/config',
'settings': __dirname+'/../../build/tmp/src/app/components/settings',
'lodash': __dirname+'/../../build/tmp/src/vendor/lodash'
},
optimize: 'uglify2',
optimizeAllPluginResources: true,
preserveLicenseComments: true,