-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
74 lines (71 loc) · 1.96 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
module.exports = function(grunt) {
// Project configuration.
grunt
.initConfig({
'git-rev-parse' : {
build: {
options: {
prop: 'git-revision',
number: 7
}
}
},
uglify : {
main : {
files :
{
'build/public/lib/app/clientApp.js' : [ 'build/public/lib/app/clientApp.js' ]
}
}
},
cssmin : {
main : {
files : {
'build/public/lib/app/app.css' : [ 'public/lib/app/app.css' ]
}
}
},
react : {
main : {
files : {
'build/public/lib/app/clientApp.js' : [ 'public/lib/app/*.jsx' ]
}
}
},
copy : {
main : {
files : [ {
expand : true,
cwd : '.',
src : [ '**', '!public/lib/app/*.jsx' ],
dest : 'build/'
}, ]
}
},
compress : {
main : {
options : {
archive : "dist/spade-client-app-<%= grunt.template.today('UTC:yyyy_mm_dd_HH_MM_ss') %>-<%= grunt.config.get('git-revision') %>.zip"
},
files : [ {
expand : true,
cwd : 'build/',
src : [ '**' ],
dest : ''
} ]
}
},
clean : [ "build", "dist" ]
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-react');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-git-rev-parse');
// Default task(s).
grunt.registerTask('default', [ 'git-rev-parse', 'clean', 'copy', 'react', 'cssmin', 'uglify',
'compress' ]);
};