-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathGruntfile.js
145 lines (129 loc) · 9.23 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
var js_arr = ['wui/js/wui_form.js', 'wui/js/wui_dialog.js', 'wui/js/wui_dropdown.js', 'wui/js/wui_range_slider.js', 'wui/js/wui_tabs.js', 'wui/js/wui_toolbar.js', 'wui/js/wui_circular_menu.js', 'wui/js/wui.js'];
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
dist: {
files: {
'dist/wui.js': js_arr,
'dist/dark/wui.css': ['wui/css/themes/dark/wui_form.css','wui/css/themes/dark/wui_dialog.css', 'wui/css/themes/dark/wui_dropdown.css', 'wui/css/themes/dark/wui_range_slider.css', 'wui/css/themes/dark/wui_tabs.css', 'wui/css/themes/dark/wui_toolbar.css', 'wui/css/themes/dark/wui_circular_menu.css', 'wui/css/wui.css'],
'dist/bright/wui.css': ['wui/css/themes/bright/wui_form.css', 'wui/css/themes/bright/wui_dialog.css', 'wui/css/themes/bright/wui_dropdown.css', 'wui/css/themes/bright/wui_range_slider.css', 'wui/css/themes/bright/wui_tabs.css', 'wui/css/themes/bright/wui_toolbar.css', 'wui/css/themes/bright/wui_circular_menu.css', 'wui/css/wui.css']
}
}
},
uglify: {
options: {
banner: '',
mangle: true,
maxLineLen: 0,
compress: {
sequences: true,
properties: true,
dead_code: true,
drop_debugger: true,
unsafe: true,
conditionals: true,
comparisons: true,
evaluate: true,
booleans: true,
loops: true,
unused: true,
hoist_funs: true,
if_return: true,
join_vars: true,
cascade: true,
warnings: true,
negate_iife: true,
pure_getters: true
},
preserveComments: false,
screwIE8: true,
mangleProperties: false,
reserveDOMProperties: true
},
target: {
files: {
'dist/wui.min.js': ['wui/js/wui_form.js', 'wui/js/wui_dialog.js', 'wui/js/wui_dropdown.js', 'wui/js/wui_range_slider.js', 'wui/js/wui_tabs.js', 'wui/js/wui_toolbar.js', 'wui/js/wui_circular_menu.js', 'wui/js/wui.js'],
'dist/widgets/WUI.min.js': ['wui/js/wui.js'],
'dist/widgets/WUI_Form/wui_form.min.js': ['wui/js/wui_form.js'],
'dist/widgets/WUI_Dialog/wui_dialog.min.js': ['wui/js/wui_dialog.js'],
'dist/widgets/WUI_DropDown/wui_dropdown.min.js': ['wui/js/wui_dropdown.js'],
'dist/widgets/WUI_RangeSlider/wui_range_slider.min.js': ['wui/js/wui_range_slider.js'],
'dist/widgets/WUI_Tabs/wui_tabs.min.js': ['wui/js/wui_tabs.js'],
'dist/widgets/WUI_ToolBar/wui_toolbar.min.js': ['wui/js/wui_toolbar.js'],
'dist/widgets/WUI_CircularMenu/wui_circular_menu.min.js': ['wui/js/wui_circular_menu.js']
}
}
},
cssmin: {
options: {
shorthandCompacting: true,
roundingPrecision: -1
},
target: {
files: {
'dist/dark/wui.min.css': ['wui/css/themes/dark/wui_form.css', 'wui/css/themes/dark/wui_dialog.css', 'wui/css/themes/dark/wui_dropdown.css', 'wui/css/themes/dark/wui_range_slider.css', 'wui/css/themes/dark/wui_tabs.css', 'wui/css/themes/dark/wui_toolbar.css', 'wui/css/themes/dark/wui_circular_menu.css', 'wui/css/wui.css'],
'dist/bright/wui.min.css': ['wui/css/themes/bright/wui_form.css', 'wui/css/themes/bright/wui_dialog.css', 'wui/css/themes/bright/wui_dropdown.css', 'wui/css/themes/bright/wui_range_slider.css', 'wui/css/themes/bright/wui_tabs.css', 'wui/css/themes/bright/wui_toolbar.css', 'wui/css/themes/bright/wui_circular_menu.css', 'wui/css/wui.css'],
'dist/widgets/WUI.min.css': ['wui/css/wui.css'],
'dist/widgets/WUI_Form/dark/wui_form.min.css': ['wui/css/themes/dark/wui_form.css'],
'dist/widgets/WUI_Dialog/dark/wui_dialog.min.css': ['wui/css/themes/dark/wui_dialog.css'],
'dist/widgets/WUI_DropDown/dark/wui_dropdown.min.css': ['wui/css/themes/dark/wui_dropdown.css'],
'dist/widgets/WUI_RangeSlider/dark/wui_range_slider.min.css': ['wui/css/themes/dark/wui_range_slider.css'],
'dist/widgets/WUI_Tabs/dark/wui_tabs.min.css': ['wui/css/themes/dark/wui_tabs.css'],
'dist/widgets/WUI_ToolBar/dark/wui_toolbar.min.css': ['wui/css/themes/dark/wui_toolbar.css'],
'dist/widgets/WUI_CircularMenu/dark/wui_circular_menu.min.css': ['wui/css/themes/dark/wui_circular_menu.css'],
'dist/widgets/WUI.min.css': ['wui/css/wui.css'],
'dist/widgets/WUI_Form/bright/wui_form.min.css': ['wui/css/themes/bright/wui_form.css'],
'dist/widgets/WUI_Dialog/bright/wui_dialog.min.css': ['wui/css/themes/bright/wui_dialog.css'],
'dist/widgets/WUI_DropDown/bright/wui_dropdown.min.css': ['wui/css/themes/bright/wui_dropdown.css'],
'dist/widgets/WUI_RangeSlider/bright/wui_range_slider.min.css': ['wui/css/themes/bright/wui_range_slider.css'],
'dist/widgets/WUI_Tabs/bright/wui_tabs.min.css': ['wui/css/themes/bright/wui_tabs.css'],
'dist/widgets/WUI_ToolBar/bright/wui_toolbar.min.css': ['wui/css/themes/bright/wui_toolbar.css'],
'dist/widgets/WUI_CircularMenu/bright/wui_circular_menu.min.css': ['wui/css/themes/bright/wui_circular_menu.css']
}
}
},
compress: {
options: {
mode: 'gzip',
level: 9
},
target: {
files: [
{expand: true, src: ['dist/wui.min.js'], dest: '', ext: '.gz.js'},
{expand: true, src: ['dist/dark/wui.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/bright/wui.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI_Form/dark/wui_form.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI_Dialog/dark/wui_dialog.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI_DropDown/dark/wui_dropdown.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI_RangeSlider/dark/wui_range_slider.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI_Tabs/dark/wui_tabs.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI_ToolBar/dark/wui_toolbar.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI_CircularMenu/dark/wui_circular_menu.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI_Form/bright/wui_form.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI_Dialog/bright/wui_dialog.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI_DropDown/bright/wui_dropdown.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI_RangeSlider/bright/wui_range_slider.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI_Tabs/bright/wui_tabs.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI_ToolBar/bright/wui_toolbar.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI_CircularMenu/bright/wui_circular_menu.min.css'], dest: '', ext: '.gz.css'},
{expand: true, src: ['dist/widgets/WUI.min.js'], dest: '', ext: '.gz.js'},
{expand: true, src: ['dist/widgets/WUI_Form/wui_form.min.js'], dest: '', ext: '.gz.js'},
{expand: true, src: ['dist/widgets/WUI_Dialog/wui_dialog.min.js'], dest: '', ext: '.gz.js'},
{expand: true, src: ['dist/widgets/WUI_DropDown/wui_dropdown.min.js'], dest: '', ext: '.gz.js'},
{expand: true, src: ['dist/widgets/WUI_RangeSlider/wui_range_slider.min.js'], dest: '', ext: '.gz.js'},
{expand: true, src: ['dist/widgets/WUI_Tabs/wui_tabs.min.js'], dest: '', ext: '.gz.js'},
{expand: true, src: ['dist/widgets/WUI_ToolBar/wui_toolbar.min.js'], dest: '', ext: '.gz.js'},
{expand: true, src: ['dist/widgets/WUI_CircularMenu/wui_circular_menu.min.js'], dest: '', ext: '.gz.js'}
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.registerTask('dist', ['concat', 'cssmin', 'uglify', 'compress']);
}