-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathGruntfile.js
103 lines (98 loc) · 3.48 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
102
103
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bower: {
dev: {
dest: 'server/static/',
js_dest: 'server/static/bower/js',
css_dest: 'server/static/bower/css',
options: {
packageSpecific: {
bootstrap: {
files: [
"dist/css/bootstrap.css",
"dist/css/bootstrap-grid.css",
"dist/css/bootstrap-reboot.css",
]
}
}
}
}
},
uglify: {
options: {
mangle: false,
compress: false
},
my_target: {
files: {
'server/dist/js/bikinirepair.js': ['server/static/js/bikinirepair.js'],
'server/dist/js/angular.js': [
'server/static/bower/js/angular.js',
'server/static/bower/js/angular-route.js',
'server/static/bower/js/ui-bootstrap-tpls.js'
],
'server/dist/js/jquery.js': ['server/static/bower/js/dist/jquery.js'],
'server/dist/js/underscore.js': ['server/static/bower/js/underscore.js'],
'server/dist/js/require.js': ['server/static/bower/js/require.js'],
'server/dist/js/script.js': ['server/static/js/script.js', 'server/static/bower/js/src/md5.js']
}
}
},
cssmin: {
options: {
mergeIntoShorthands: false,
roundingPrecision: -1
},
target: {
files: {
'server/dist/css/style.css': [
'server/static/bower/css/dist/css/bootstrap.css',
'server/static/bower/css/dist/css/bootstrap-grid.css',
'server/static/bower/css/dist/css/bootstrap-reboot.css',
'server/static/css/style.css'
]
}
}
},
htmlmin: {
dist: {
options: {
removeComments: true,
collapseWhitespace: true
},
files: {
'server/dist/index.html': 'server/static/index.html'
}
}
},
watch: {
configFiles: {
files: [ 'Gruntfile.js', 'config/*.js' ],
options: {
reload: true
}
},
scripts: {
files: ['server/static/**/*.js'],
tasks: ['uglify']
},
css: {
files: ['server/static/**/*.css'],
tasks: ['cssmin']
},
html: {
files: ['server/static/**/*.html'],
tasks: ['htmlmin']
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-bower');
grunt.registerTask('default', ['bower', 'uglify', 'cssmin', 'htmlmin']);
grunt.registerTask('dev', ['watch']);
};