forked from Attendize/Attendize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
96 lines (93 loc) · 3.66 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
module.exports = function (grunt) {
//Initializing the configuration object
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Task configuration
less: {
development: {
options: {
compress: true,
javascriptEnabled: true,
},
files: {
"./public/assets/stylesheet/application.css": "./public/assets/stylesheet/application.less",
"./public/assets/stylesheet/frontend.css": "./public/assets/stylesheet/frontend.less",
}
},
},
concat: {
options: {
separator: ';',
stripBanners: {
block: true,
line: true
},
},
js_frontend: {
src: [
'./public/vendor/jquery/dist/jquery.min.js',
'./public/vendor/bootstrap/dist/js/bootstrap.js',
'./public/vendor/jquery-form/jquery.form.js',
'./public/vendor/RRSSB/js/rrssb.js',
'./public/vendor/humane-js/humane.js',
'./public/vendor/jquery.payment/lib/jquery.payment.js',
'./public/assets/javascript/app-public.js'
],
dest: './public/assets/javascript/frontend.js',
},
js_backend: {
src: [
'./public/vendor/modernizr/modernizr.js',
'./public/vendor/html.sortable/dist/html.sortable.js',
'./public/vendor/bootstrap/dist/js/bootstrap.js',
'./public/vendor/jquery-form/jquery.form.js',
'./public/vendor/humane-js/humane.js',
'./public/vendor/RRSSB/js/rrssb.js',
'./public/vendor/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.js',
'./public/vendor/datetimepicker/dist/DateTimePicker.js',
'./public/vendor/jquery-minicolors/jquery.minicolors.min.js',
'./public/assets/javascript/app.js'
],
dest: './public/assets/javascript/backend.js',
},
},
uglify: {
options: {
mangle: true, // Use if you want the names of your functions and variables unchanged
preserveComments: false,
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */',
},
frontend: {
files: {
'./public/assets/javascript/frontend.js': ['<%= concat.js_frontend.dest %>'],
}
},
backend: {
files: {
'./public/assets/javascript/backend.js': './public/assets/javascript/backend.js',
}
},
},
watch: {
scripts: {
files: ['./public/assets/**/*.js'],
tasks: ['default'],
options: {
spawn: false,
},
},
}
});
// Plugin loading
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
// Task definition
grunt.registerTask('default', ['less', 'concat']);
grunt.registerTask('deploy', ['less', 'concat', 'uglify']);
grunt.registerTask('js', ['concat']);
grunt.registerTask('styles', ['concat']);
grunt.registerTask('minify', ['uglify']);
};