forked from thran/ufobal-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
111 lines (107 loc) · 4.21 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
libs: {
src: [
'bower_components/foundation/js/vendor/modernizr.js',
'bower_components/foundation/js/vendor/fastclick.js',
'bower_components/foundation/js/vendor/jquery.js',
'bower_components/angular/angular.min.js',
'bower_components/angular-cookies/angular-cookies.min.js',
'bower_components/angular-foundation/mm-foundation-tpls.min.js',
'bower_components/angular-route/angular-route.min.js',
'bower_components/angular-smart-table/dist/smart-table.min.js',
'bower_components/angular-equalizer/angular-equalizer.js',
'bower_components/moment/min/moment.min.js',
'bower_components/humanize-duration/humanize-duration.js',
'bower_components/foundation/js/foundation.min.js',
'bower_components/toastr/toastr.min.js',
'ufobalapp/static/ufobalapp/js/libs/star-rating.js'
],
dest: 'static/dist/libs.min.js'
},
managestats: {
src: ['managestats/static/managestats/js/*.js'],
dest: 'static/dist/managestats.js'
},
ufobalapp: {
src: ['ufobalapp/static/ufobalapp/js/*.js', 'static/dist/templates.js'],
dest: 'static/dist/ufobalapp.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %>-libs <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
managestats: {
src: 'static/dist/managestats.js',
dest: 'static/dist/managestats.min.js'
},
ufobalapp: {
src: 'static/dist/ufobalapp.js',
dest: 'static/dist/ufobalapp.min.js'
}
},
watch: {
files: [
'managestats/static/managestats/js/*.js',
"managestats/static/managestats/css/*.css",
'ufobalapp/static/ufobalapp/js/*.js',
"ufobalapp/static/ufobalapp/css/*.css",
"ufobalapp/static/ufobalapp/ng-parts/**/*.html"
],
tasks: ['jshint', 'ngtemplates', 'concat', 'uglify:ufobalapp', 'uglify:managestats', "cssmin"]
},
cssmin: {
target: {
files: {
'static/dist/managestats.min.css': [
"bower_components/foundation/css/normalize.css",
"bower_components/foundation/css/foundation.css",
"bower_components/foundation-icon-fonts/foundation-icons.css",
'managestats/static/managestats/css/*.css'
],
'static/dist/ufobalapp.min.css': [
"bower_components/foundation/css/normalize.css",
"bower_components/foundation/css/foundation.css",
"bower_components/foundation-icon-fonts/foundation-icons.css",
"bower_components/toastr/toastr.css",
'ufobalapp/static/ufobalapp/css/*.css'
]
}
}
},
ngtemplates: {
ufoIS: {
cwd: "ufobalapp/static/ufobalapp/ng-parts",
src: '**/*.html',
dest: 'static/dist/templates.js'
}
},
jshint: {
files: ['managestats/static/managestats/js/*.js', 'ufobalapp/static/ufobalapp/js/*.js']
},
copy: {
fonts: {
expand: true,
cwd: "bower_components/foundation-icon-fonts/",
src: [
"foundation-icons.eot",
"foundation-icons.svg",
"foundation-icons.ttf",
"foundation-icons.woff"
],
dest: 'static/dist/'
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-angular-templates');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('default', ['jshint', 'ngtemplates', 'concat', 'uglify', "cssmin", "copy"]);
};