-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
60 lines (59 loc) · 2.13 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
module.exports = function(grunt) {
//grunt wrapper function
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
//grunt task configuration will go here
ngAnnotate: {
options: {
singleQuotes: true
},
app: {
files: {
'./public/min-safe/js/static.js': ['./public/static/js/*.js','./public/static/js/*/*.js'],
'./public/min-safe/js/vendors/all-vendors.js': ['./public/vendors/js/libraries/*.js','./public/vendors/js/*.js', './public/vendors/js/modules/*.js'],
'./public/min-safe/app.js': ['./public/static/js/app.js']
}
}
},
concat: {
js: { //target
src: [ './public/min-safe/app.js', './public/min-safe/js/*.js'],
dest: './public/min/app.js'
}, vendors: { //target
src: [ './public/min-safe/js/vendors/*.js'],
dest: './public/min/vendors.js'
}, css :{
//target
src: ['./public/vendors/css/*.css', './public/static/css/*.css'],
dest: './public/css/min/app.css'
}
},
uglify: {
js: { //target
src: ['./public/min/app.js'],
dest: './public/min/app.js'
},vendors: { //target
src: ['./public/min/vendors.js'],
dest: './public/min/vendors.js'
}
},
cssmin: {
options: {
shorthandCompacting: false,
roundingPrecision: -1
},
target: {
files: {
'./public/min/app.css': ['./public/css/min/app.css']
}
}
}
});
//load grunt tasks
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-ng-annotate');
grunt.loadNpmTasks('grunt-contrib-cssmin');
//register grunt default task
grunt.registerTask('default', ['ngAnnotate', 'concat', 'uglify', 'cssmin']);
};