-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
101 lines (88 loc) · 2.6 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
94
95
96
97
98
99
100
101
module.exports = function (grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
temp: [
"dist/js/scripts.js",
"dist/js/libs.js",
"dist/js/scripts.min.js",
"dist/js/libs.min.js"
],
all: ["dist/"]
},
jshint: {
dist: {
src: ["js/**/*.js"]
}
},
concat: {
scripts: {
src: [
'assets/js/**/*.js',
"js/**/*.js"
],
dest: "dist/js/scripts.js"
},
libs: {
src: [
"lib/angular/angular-messages.js",
"lib/angular/angular-route.js",
"lib/angular/angular.js"
],
dest: "dist/js/libs.js"
},
all: {
src: [
"dist/js/scripts.min.js",
"dist/js/libs.min.js"
],
dest: "dist/js/all.min.js"
}
},
uglify: {
scripts: {
src: ["dist/js/scripts.js"],
dest: "dist/js/scripts.min.js"
},
libs: {
src: ["dist/js/libs.js"],
dest: "dist/js/libs.min.js"
}
},
cssmin: {
all: {
src: [
'assets/css/**/*.css',
'assets/font-awesome/**/*.css'
],
dest: "dist/css/styles.min.css"
}
},
htmlmin:{
views: {
options: {
collapseWhitespace: true,
removeComments: true
},
expand: true,
cwd: "view/",
src: ["*.html"],
dest: "dist/view"
}
},
copy: {
all: {
src: "index-prod.html",
dest: "dist/index.html"
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask("default", ["clean:all", "jshint", "concat:scripts", "concat:libs", "uglify", "concat:all", "cssmin", "htmlmin", "copy", "clean:temp"]);
}