forked from EclipseFdn/fedgeoday
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
93 lines (93 loc) · 2.85 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
module.exports = function(grunt) {
// Initializing the configuration object
grunt.initConfig({
copy: {
main: {
files: [
// includes files within path
{
expand: true,
flatten: true,
src: ['bower_components/bootstrap/fonts/*'],
dest: './fonts/',
filter: 'isFile'
},
{
expand: true,
flatten: true,
src: ['bower_components/fontawesome/fonts/*'],
dest: './fonts/',
filter: 'isFile'
},
]
}
},
// Task configuration
less: {
development: {
options: {
compress: true,
// minifying the result
},
files: {
// compiling styles.less into styles.css
'./css/main.min.css': './src/less/main.less'
}
}
},
concat: {
options: {
separator: ';',
},
js_frontend: {
src: [
'./bower_components/jquery/dist/jquery.js',
'./bower_components/bootstrap/dist/js/bootstrap.min.js',
'./src/js/plugins.js',
'./src/js/main.js'
],
dest: './js/main.js',
},
},
uglify: {
options: {
mangle: false
// Use if you want the names of your functions and variables
// unchanged.
},
frontend: {
files: {
'./js/main.min.js' : './js/main.js',
}
},
},
watch: {
js_frontend: {
files: [
// watched files
'./bower_components/bootstrap/dist/js/bootstrap.js',
'./src/js/main.js',
'./src/js/plugins.js',
],
// tasks to run
tasks: ['concat:js_frontend', 'uglify:frontend'],
},
less: {
files: ['./src/less/*.less',
'./src/less/**/*.less'
],
// watched files
tasks: ['less'],
// tasks to run
},
}
});
// Plugin loading
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
// Task definition
grunt.registerTask('default', ['watch']);
};