-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntFile.js
89 lines (87 loc) · 2.15 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
module.exports = function(grunt) {
grunt.initConfig({
concat: {
process_function: {
options: {
process: function(src, filepath) {
return "// Source: " + (filepath.substr(10)) + "\n" +
src.replace(/file(\d)/, "f$1");
}
},
files: {
"public/js/main.js": ["public/js/script.js", "public/js/*.js", "!public/js/*.min.js", "!public/js/main.js"]
}
},
},
cssmin: {
target: {
files: [{
expand: true,
cwd: "public/css/",
src: ["*.css", "!*.min.css"],
dest: "public/css/",
ext: ".min.css"
}]
}
},
uglify: {
options: {
mangle: true
},
my_target: {
files: {
"public/js/main.min.js": ["public/js/main.js"]
}
}
},
jshint: {
files: ["public/js/*.js", "!public/js/*.min.js", "!public/js/main.js"],
options: {
globals: {
jQuery: true
}
}
},
sass: {
dist: {
files: [{
expand: true,
cwd: "public/sass/",
src: ["*.scss"],
dest: "public/css/",
ext: ".css"
}]
}
},
watch: {
concat: {
files: ["public/js/*.js", "!public/js/*.min.js"],
tasks: ["concat"]
},
cssmin: {
files: ["public/css/*.css", "!public/css/*.min.css"],
tasks: ["cssmin"]
},
sass: {
files: ["public/sass/*.scss"],
tasks: ["sass"]
},
uglify: {
files: ["public/js/*.js", "!public/js/*.min.js"],
tasks: ["uglify"]
},
jshint: {
files: ["public/js/*.js", "!public/js/*.min.js", "!public/js/main.js"],
tasks: ["jshint"]
}
}
});
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-sass");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.registerTask("default", ["watch"]);
grunt.registerTask("all", ["sass", "cssmin", "concat", "uglify"]);
};