-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
95 lines (91 loc) · 4.4 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
module.exports = function(grunt) {
let currentYear = '2020';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
copy: {
main: {
files: [
{expand: true, cwd: 'assets/bower_components/bootstrap/fonts/', src: ['**'], dest: 'www/static/' + currentYear + '/fonts/'},
{expand: true, cwd: 'assets/fonts/icomoon/', src: ['**'], dest: 'www/static/' + currentYear + '/fonts/'},
],
},
},
less: {
main: {
options: {
compress: true,
sourceMap: false
},
files: {
['www/static/' + currentYear + '/css/main.css']: [
'assets/css/pure/pure.css',
'assets/css/icomoon.css',
'assets/less/main.less',
'assets/less/flash.less',
'assets/bower_components/slick-carousel/slick/slick.less'
],
['www/static/' + currentYear + '/css/admin.css']: [
'assets/bower_components/bootstrap/dist/css/bootstrap.css',
'assets/bower_components/happy/dist/happy.css',
'assets/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css',
'assets/bower_components/ublaboo-datagrid/assets/dist/datagrid.css',
'assets/bower_components/ublaboo-datagrid/assets/dist/datagrid-spinners.css',
'assets/bower_components/bootstrap-select/dist/css/bootstrap-select.css',
'assets/bower_components/semantic-ui-transition/transition.css',
'assets/bower_components/semantic-ui-dropdown/dropdown.css',
'assets/less/admin.less'
]
}
}
},
uglify: {
options: {
sourceMap: false,
beautify: true
},
default: {
files: {
['www/static/' + currentYear + '/js/main.js']: [
'assets/js/jquery-3.1.1.js',
'assets/bower_components/slick-carousel/slick/slick.js',
'vendor/nette/forms/src/assets/netteForms.js',
'assets/bower_components/nette.ajax.js/nette.ajax.js',
'assets/js/main.js'
],
['www/static/' + currentYear + '/js/admin.js']: [
'assets/bower_components/jquery/dist/jquery.js',
'assets/bower_components/nette-forms/src/assets/netteForms.js',
'assets/bower_components/nette.ajax.js/nette.ajax.js',
'assets/bower_components/happy/dist/happy.js',
'assets/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.js',
'assets/bower_components/jquery-ui-sortable/jquery-ui-sortable.js',
'assets/bower_components/ublaboo-datagrid/assets/dist/datagrid.js',
'assets/bower_components/ublaboo-datagrid/assets/dist/datagrid-instant-url-refresh.js',
'assets/bower_components/ublaboo-datagrid/assets/dist/datagrid-spinners.js',
'assets/bower_components/bootstrap/dist/js/bootstrap.js',
'assets/bower_components/bootstrap-select/dist/js/bootstrap-select.js',
'assets/bower_components/semantic-ui-transition/transition.js',
'assets/bower_components/semantic-ui-dropdown/dropdown.js',
'assets/bower_components/clipboard/dist/clipboard.js',
'assets/js/admin.js'
]
}
}
},
watch: {
js: {
files: 'assets/js/*.js',
tasks: ['uglify']
},
less: {
files: 'assets/less/*.less',
tasks: ['less']
},
},
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['copy', 'less', 'uglify']);
};