-
Notifications
You must be signed in to change notification settings - Fork 8
/
Gruntfile.js
117 lines (113 loc) · 3.63 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
112
113
114
115
116
117
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: require('fs').readFileSync('banner.txt').toString(),
copy: {
fonts: {
expand: true,
flatten: true,
filter: 'isFile',
src: 'bower_components/font-awesome/fonts/*',
dest: 'web/fonts/'
}
},
concat: {
options: {
separator: ';'
},
ie8: {
src: [
'bower_components/html5shiv/src/html5shiv.js',
'bower_components/respond/src/respond.js'
],
dest: 'web/js/ie8.js'
},
amsterdamphpjs: {
src: [
'bower_components/jquery/jquery.js',
'bower_components/bootstrap/js/transition.js',
'bower_components/bootstrap/js/alert.js',
'bower_components/bootstrap/js/button.js',
'bower_components/bootstrap/js/carousel.js',
'bower_components/bootstrap/js/collapse.js',
'bower_components/bootstrap/js/dropdown.js',
'bower_components/bootstrap/js/modal.js',
'bower_components/bootstrap/js/tooltip.js',
'bower_components/bootstrap/js/popover.js',
'bower_components/bootstrap/js/scrollspy.js',
'bower_components/bootstrap/js/tab.js',
'bower_components/bootstrap/js/affix.js'
],
dest: 'web/js/amsterdamphp.js'
}
},
less: {
amsterdamphpcss: {
src: [
'app/Resources/less/amsterdamphp.less'
],
dest: 'web/css/amsterdamphp.css'
}
},
uglify: {
ie8: {
options: {
report: 'min',
banner: '<%= banner %>'
},
files: {
'web/js/ie8.js': [
'web/js/ie8.js'
]
}
},
amsterdamphpjs: {
options: {
report: 'min',
banner: '<%= banner %>'
},
files: {
'web/js/amsterdamphp.js': [
'web/js/amsterdamphp.js'
]
}
}
},
cssmin: {
amsterdamphpcss: {
options: {
report: 'min',
banner: '<%= banner %>'
},
src: [
'web/css/amsterdamphp.css'
],
dest: 'web/css/amsterdamphp.css'
}
},
watch: {
files: [
'bower_components/**', // Admittedly this might be a bit overkill...
'app/Resources/less/elements.less',
'app/Resources/less/amsterdamphp.less'
],
tasks: [
'concat',
'less'
]
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('default', [
'copy',
'concat',
'less',
'uglify',
'cssmin'
]);
};