Browse Source

tech(systemjs): more fixes for optmized build

Torkel Ödegaard 10 years ago
parent
commit
0a9f705308

+ 0 - 1
public/app/boot.js

@@ -2,7 +2,6 @@
   'use strict';
 
   System.import('app/app').then(function(app) {
-    console.log(app);
     app.init();
   }).catch(function(err) {
     console.log('Loading app module failed: ', err);

+ 0 - 1
public/app/core/controllers/grafana_ctrl.ts

@@ -8,7 +8,6 @@ import $ from 'jquery';
 import coreModule from '../core_module';
 
 coreModule.controller('GrafanaCtrl', function($scope, alertSrv, utilSrv, $rootScope, $controller, contextSrv) {
-  console.log('grafana ctrl');
 
   $scope.init = function() {
     $scope.contextSrv = contextSrv;

+ 1 - 0
public/app/core/controllers/signup_ctrl.ts

@@ -6,6 +6,7 @@ import coreModule from '../core_module';
 
 export class SignUpCtrl {
 
+  /** @ngInject */
   constructor(
       private $scope : any,
       private $location : any,

+ 1 - 0
public/app/features/dashboard/timepicker/timepicker.ts

@@ -30,6 +30,7 @@ export class TimePickerCtrl {
   isOpen: boolean;
   isUtc: boolean;
 
+  /** @ngInject */
   constructor(private $scope, private $rootScope, private timeSrv) {
     $scope.ctrl = this;
 

+ 0 - 4
public/app/grafana.ts

@@ -17,9 +17,6 @@ import bootstrap = require('bootstrap');
 import kbn = require('app/core/utils/kbn');
 import config = require('app/core/config');
 
-//  import {Component} from 'angular2/core';
-// console.log(Component);
-
 export class GrafanaApp {
   registerFunctions: any;
   ngModuleDependencies: any[];
@@ -46,7 +43,6 @@ export class GrafanaApp {
     app.constant('grafanaVersion', "@grafanaVersion@");
 
     app.config(($locationProvider, $controllerProvider, $compileProvider, $filterProvider, $provide) => {
-      console.log('app config');
       this.registerFunctions.controller = $controllerProvider.register;
       this.registerFunctions.directive  = $compileProvider.directive;
       this.registerFunctions.factory    = $provide.factory;

+ 3 - 0
public/app/system.conf.js

@@ -34,6 +34,9 @@ System.config({
     vendor: {
       defaultExtension: 'js',
     },
+    test: {
+      defaultExtension: 'js',
+    },
   },
 
   map: {

+ 3 - 3
tasks/build_task.js

@@ -19,10 +19,10 @@ module.exports = function(grunt) {
     'ngAnnotate:build',
     'systemjs:build',
     'concat:js',
-    // 'filerev',
-    // 'remapFilerev',
+    'filerev',
+    'remapFilerev',
     'usemin',
-    // 'uglify:genDir'
+    'uglify:genDir'
   ]);
 
   // task to add [[.AppSubUrl]] to reved path

+ 1 - 1
tasks/options/filerev.js

@@ -14,7 +14,7 @@ module.exports = function(config) {
       dest: '<%= genDir %>/css'
     },
     js: {
-      src: '<%= genDir %>/app/app.js',
+      src: '<%= genDir %>/app/boot.js',
       dest: '<%= genDir %>/app'
     }
   };

+ 5 - 5
tasks/systemjs_task.js

@@ -13,10 +13,10 @@ module.exports = function(grunt) {
     var modules = [
       'app/app',
       'app/features/all',
-      'app/plugins/panels/**/*',
-      'app/plugins/datasource/graphite/**/*',
-      'app/plugins/datasource/influxdb/**/*',
-      'app/plugins/datasource/elasticsearch/**/*',
+      'app/plugins/panels/**/module',
+      'app/plugins/datasource/graphite/datasource',
+      'app/plugins/datasource/influxdb/datasource',
+      'app/plugins/datasource/elasticsearch/datasource',
     ];
 
     var expression = modules.join(' + ');
@@ -31,7 +31,7 @@ module.exports = function(grunt) {
       .catch(function(err) {
         console.log('Build error');
         console.log(err);
-        done();
+        done(false);
       });
   });
 };