11/* jshint node: true*/
22'use strict' ;
33module . exports = function ( grunt ) {
4- var target = grunt . option ( 'target' ) || 'http://owennw.github.io/OpenFinD3FC' ,
5- port = process . env . PORT || 5000 ,
6- files = {
7- js : [
8- 'gruntfile.js' ,
9- 'src/**/*.js' ,
10- 'src/**/*.json' ,
11- '*.json'
12- ] ,
13- html : [
14- 'src/**/*.html'
15- ] ,
16- css : [
17- 'src/**/*.css' ,
18- 'src/**/*.less'
19- ] ,
20- showcase : [
21- 'node_modules/d3fc-showcase/dist/'
22- ]
23- } ;
4+ var target = grunt . option ( 'target' ) || 'http://scottlogic.github.io/bitflux-openfin' ,
5+ port = process . env . PORT || 5000 ;
246
257 grunt . initConfig ( {
268 'gh-pages' : {
@@ -35,7 +17,7 @@ module.exports = function(grunt) {
3517 options : {
3618 base : 'public' ,
3719 message : 'Deploy to GitHub Pages' ,
38- repo : 'https://github.com/owennw/OpenFinD3FC .git'
20+ repo : 'https://github.com/ScottLogic/bitflux-openfin .git'
3921 } ,
4022 src : [ '**/*' ]
4123 }
@@ -64,7 +46,7 @@ module.exports = function(grunt) {
6446 filePath : 'public/app.json' ,
6547 options : {
6648 startup_app : {
67- url : target + '/index .html' ,
49+ url : target + '/parent .html' ,
6850 applicationIcon : target + '/favicon.ico'
6951 } ,
7052 shortcut : {
@@ -106,8 +88,8 @@ module.exports = function(grunt) {
10688
10789 download : {
10890 openfinZip : {
109- src : [ 'https://dl.openfin.co/services/download?fileName=OpenFinD3FC &config=http://owennw .github.io/OpenFinD3FC /app.json' ] ,
110- dest : './public/OpenFinD3FC .zip'
91+ src : [ 'https://dl.openfin.co/services/download?fileName=bitflux-openfin &config=http://scottlogic .github.io/bitflux-openfin /app.json' ] ,
92+ dest : './public/bitflux-openfin .zip'
11193 }
11294 } ,
11395
@@ -166,10 +148,10 @@ module.exports = function(grunt) {
166148 src : [ '**/*.html' ] ,
167149 dest : 'public'
168150 } ,
169- js : {
151+ json : {
170152 expand : true ,
171153 cwd : 'src/' ,
172- src : [ '**/*.js' , '**/*. json'] ,
154+ src : [ '**/*.json' ] ,
173155 dest : 'public'
174156 } ,
175157 icons : {
@@ -186,6 +168,35 @@ module.exports = function(grunt) {
186168 dest : 'public/assets/fonts'
187169 } ]
188170 }
171+ } ,
172+ concat : {
173+ dist : {
174+ src : [ 'src/**/*.js' ] ,
175+ dest : 'public/app.js'
176+ } ,
177+ parent : {
178+ src : [ 'src/parentApp.js' , 'src/parent-controller.js' , 'src/store-service.js' , 'src/window-service.js' ] ,
179+ dest : 'public/app-parent.js'
180+ }
181+ } ,
182+
183+ uglify : {
184+ dist : {
185+ files : {
186+ 'public/app.js' : [ 'public/app.js' ]
187+ }
188+ }
189+ } ,
190+ babel : {
191+ options : {
192+ sourceMap : false
193+ } ,
194+ dist : {
195+ files : {
196+ 'public/app.js' : 'public/app.js' ,
197+ 'public/app-parent.js' : 'public/app-parent.js'
198+ }
199+ }
189200 }
190201 } ) ;
191202
@@ -200,7 +211,10 @@ module.exports = function(grunt) {
200211 grunt . loadNpmTasks ( 'grunt-contrib-less' ) ;
201212 grunt . loadNpmTasks ( 'grunt-eslint' ) ;
202213 grunt . loadNpmTasks ( 'grunt-http-download' ) ;
214+ grunt . loadNpmTasks ( 'grunt-contrib-concat' ) ;
215+ grunt . loadNpmTasks ( 'grunt-contrib-uglify' ) ;
203216 grunt . loadNpmTasks ( 'grunt-gh-pages' ) ;
217+ grunt . loadNpmTasks ( 'grunt-babel' ) ;
204218
205219 grunt . registerTask ( 'showcase' , function ( ) {
206220 var callback = this . async ( ) ;
@@ -216,10 +230,11 @@ module.exports = function(grunt) {
216230 } ) ;
217231 } ) ;
218232
219- grunt . registerTask ( 'build' , [ 'eslint' , 'clean' , 'showcase' , 'copy' , 'less:development' , 'connect:livereload' ] ) ;
233+ grunt . registerTask ( 'build' , [ 'eslint' , 'clean' , 'showcase' , 'copy' , 'concat' , 'babel' , 'less:development' , 'connect:livereload' ] ) ;
234+ grunt . registerTask ( 'build:uglify' , [ 'build' , 'uglify' ] ) ;
220235 grunt . registerTask ( 'serve' , [ 'build' , 'openfin:serve' ] ) ;
221- grunt . registerTask ( 'createZip' , [ 'build' , 'download' ] ) ;
222- grunt . registerTask ( 'ci' , [ 'build' , 'download' ] ) ;
236+ grunt . registerTask ( 'createZip' , [ 'build:uglify ' , 'download' ] ) ;
237+ grunt . registerTask ( 'ci' , [ 'build:uglify ' , 'download' ] ) ;
223238 grunt . registerTask ( 'deploy' , [ 'ci' , 'gh-pages:origin' ] ) ;
224239 grunt . registerTask ( 'deploy:upstream' , [ 'ci' , 'gh-pages:upstream' ] ) ;
225240 grunt . registerTask ( 'default' , [ 'serve' ] ) ;
0 commit comments