-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
60 lines (52 loc) · 1.76 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Concatenate bower js and css files and place it in partyparrots/static folder
bower_concat: {
all: {
dest: {
js: 'partyparrots/static/js/bower.js',
css: 'partyparrots/static/css/bower.css'
},
mainFiles: {
'bootstrap': 'dist/css/bootstrap.css',
'font-awesome': 'css/font-awesome.css',
'angular-bootstrap': 'ui-bootstrap.js',
'angular-ticker': ['release/ticker.js', 'release/angular-ticker.css']
}
}
},
// Minify the js files
uglify: {
bower: {
options: {
mangle: true,
compress: true
},
files: {
'partyparrots/static/js/bower.min.js': 'partyparrots/static/js/bower.js'
}
}
},
// Copy font files to partyparrots/static/fonts folder
copy: {
fonts: {
files: [
{
expand: true, cwd:'bower_components/font-awesome/fonts', src: ['**'], dest: 'partyparrots/static/fonts',
expand: true, cwd:'bower_components/bootstrap/fonts', src: ['**'], dest: 'partyparrots/static/fonts',
}
]
}
}
});
// Load the plugin to minify Javascript files
grunt.loadNpmTasks('grunt-contrib-uglify');
// Load the plugin that automatically imports every file ending in .js within bower_components directory
grunt.loadNpmTasks('grunt-bower-concat');
// Load the plugin to copy fonts from bower_components to static folder
grunt.loadNpmTasks('grunt-contrib-copy');
// Create a task to run bower_concat, minify the JS files, copy the font files
grunt.registerTask('build_bower', ['bower_concat', 'uglify:bower', 'copy:fonts']);
};