This repository has been archived by the owner on Feb 21, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
76 lines (73 loc) · 1.58 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
module.exports = function(grunt) {
grunt.initConfig({
'bower-install-simple': {
options: {
directory: 'temp/bower/'
},
production: {
options: {
production: true,
interactive: false
}
}
},
concat: {
scripts: {
src: [
'temp/bower/jquery/jquery.min.js',
'assets/js/main.js',
],
dest: 'www/js/scripts.js'
},
respond: {
src: [
'temp/bower/respond/dest/respond.min.js'
],
dest: 'www/js/respond.min.js'
}
},
less: {
production: {
options: {
sourceMap: true
},
files: {
'www/styles/styles.css': 'assets/styles/styles.less'
}
}
},
uglify: {
scripts: {
src: 'www/js/scripts.js',
dest: 'www/js/scripts.js'
}
},
watch: {
scripts: {
files: ['assets/js/*.js'],
tasks: ['scripts'],
options: {
spawn: false
}
},
styles: {
files: ['assets/styles/*.less'],
tasks: ['styles'],
options: {
spawn: false
}
}
}
});
grunt.loadNpmTasks('grunt-bower-install-simple');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['development']);
grunt.registerTask('bower', ['bower-install-simple:production']);
grunt.registerTask('scripts', ['concat:scripts', 'concat:respond']);
grunt.registerTask('styles', ['less']);
grunt.registerTask('production', ['bower', 'scripts', 'styles', 'uglify:scripts']);
grunt.registerTask('development', ['bower', 'scripts', 'styles']);
};