forked from jhonylucas74/dev-podcast-list-brazil
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
81 lines (77 loc) · 2.53 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
module.exports = function(grunt) {
var project_files = {
javascript: [
'./bower_components/angular/angular.min.js',
'./bower_components/angular-slugify/angular-slugify.js',
'./bower_components/angular-route/angular-route.min.js',
'./bower_components/angular-animate/angular-animate.min.js',
'./bower_components/angular-sanitize/angular-sanitize.js',
'./bower_components/angular-bootstrap/ui-bootstrap.min.js',
'./bower_components/angular-lazy-img/release/angular-lazy-img.js',
'./bower_components/abdmob/x2js/xml2json.js',
'./bower_components/ngMeta/dist/ngMeta.js',
'!./app/app.min.js',
'!./app/view/',
'./app/app.js',
'./app/directives/*.js',
'./app/factory/*.js',
'./app/filter/*.js',
'./app/controller/*.js',
'./app/routes.js',
],
stylesheet: [
'./bower_components/font-awesome/css/font-awesome.css',
'!./assets/css/app.min.css',
'./assets/css/bootstrap.css',
'./assets/css/app.css',
],
};
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
json: {
src: ['./data/podcasts_pt_br.json','./data/podcasts_en.json'],
dest: './data/podcasts.json'
}
},
uglify: {
options: {
banner: '/*===================================================== \n'
+'= <%= pkg.name %> \n'
+'= by <%= pkg.homepage %> \n'
+'= [LAST BUILD: <%= grunt.template.today("yyyy-mm-dd HH:MM:ss") %>] \n'
+'=====================================================*/\n'
},
build: {
src: project_files.javascript,
dest: './app/app.min.js'
},
},
cssmin : {
options : {
keepSpecialComments: 0,
rebase: false,
},
dist: {
src: project_files.stylesheet,
dest: './assets/css/app.min.css',
}
},
watch: {
scripts: {
files: [project_files.javascript, project_files.stylesheet],
tasks: ['default']
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('concat', ['concat']);
grunt.registerTask('default', ['uglify', 'cssmin']);
grunt.event.on('watch', function(action, filepath, target) {
grunt.log.writeln(target + ': ' + filepath + ' has ' + action);
});
};