This repository has been archived by the owner on Jan 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
93 lines (82 loc) · 1.96 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
'use strict';
module.exports = function(grunt){
/* Configure
============================ */
var configs = {
css_combine_files : [
'src/vendor/css/bootstrap.min.css',
'src/css/combined.css'],
js_combine_files : [
'src/vendor/js/jquery-1.10.1.min.js',
'src/vendor/js/modernizr-2.6.2-respond-1.1.0.min.js',
'src/vendor/js/bootstrap.min.js',
'src/js/main.js'],
js_hint_files : [
'src/js/main.js'],
watch_files : [
'assets/sass/**/*',
'src/js/*',
'src/vendor/css/*',
'src/vendor/js/*']
}
/* Init
============================ */
grunt.initConfig({
sass: {
options: {
sourceMap: true
},
dist: {
files: {
"assets/css/main.css" : "assets/sass/main.scss"
}
}
},
jshint: {
beforeconcat: configs.js_hint_files
},
concat: {
options: {
separator: ';',
},
dist: {
src: configs.js_combine_files,
dest: 'src/js/compiled.js',
},
},
uglify: {
my_target: {
files: {
'dist/js/compiled.min.js' : 'src/js/compiled.js'
}
}
},
cssmin: {
combine: {
files: {
'assets/css/main.min.css' : configs.css_combine_files
}
}
},
watch: {
src: {
files: configs.watch_files,
tasks: ['build']
}
}
});
// Add plugins
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
// Register tasks
// grunt.registerTask('build', ['sass','cssmin','concat','uglify','jshint']);
grunt.registerTask('build', ['sass']);
grunt.registerTask('default', ['build']);
grunt.event.on('watch', function(action, filepath) {
grunt.log.writeln(filepath + ' has ' + action);
});
};