-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGrunt_pro.js
101 lines (91 loc) · 3.15 KB
/
Grunt_pro.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) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
pre: ['build'],
post: ['build/js/controllers',
'build/js/*js',
'build/css/css',
'build/css/*less'
]
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
},
js: {
files: [{
src: 'build/js/min/<%= pkg.name %>.js',
dest: 'build/js/min/<%= pkg.name %>.min.js'
}]
}
},
concat: {
libsJS: {
src: [
//NOTE- If we add more libs there need to be added to the build here;
'node_modules/angular/angular.js',
'node_modules/angular-ui-router/release/angular-ui-router.min.js',
'build/js/app.js',
'build/js/directives.js',
//controllers
'build/js/controllers/account-controller.js',
'build/js/controllers/dashboard-controller.js',
'build/js/controllers/patron-controller.js',
'build/js/controllers/game-controller.js',
'build/js/controllers/reports-controller.js',
//libs
'node_modules/sweetalert/dist/sweetalert.min.js',
'node_modules/d3/build/d3.min.js',
'node_modules/jquery/dist/jquery.js',
'node_modules/offcanvas-bootstrap/dist/js/bootstrap.offcanvas.min.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'build/js/common.js'
],
dest: 'build/js/min/<%= pkg.name %>.js'
}
},
copy: {
js: {
expand: true,
src: ['js/*', 'js/*/*', 'js/*/*/*', 'js/*/*/*/*'],
dest: 'build/'
},
css: {
src: 'css/*less',
dest: 'build/'
}
},
less: {
compile: {
options: {
compress: true,
strictMath: true,
sourceMap: true,
outputSourceFiles: true,
sourceMapURL: '<%= pkg.name %>.css.map',
sourceMapFilename: 'build/css/<%= pkg.name %>.css.map'
},
files: {
'build/css/<%= pkg.name %>.min.css': 'css/counter-main.less'
}
}
}
});
//load all tasks;
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
// Default task(s).
grunt.registerTask('default', [
'clean:pre',
'copy',
'concat',
'uglify',
'less',
'clean:post'
]);
};