forked from liuhuisheng/dhtmlx_web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
145 lines (142 loc) · 9.09 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>; */\n'
},
my_target: {
files: {
'build/app.js': [
'assets/lib/jquery/jquery-1.11.2.min.js',
'assets/lib/jquery/jquery-ui.js',
'assets/lib/jquery/jquery.cookie.js',
'assets/vendors/jquery-pulsate/jquery.pulsate.custom.js',
'assets/vendors/jquery-slimscroll/jquery.slimscroll.min.js',
//'assets/vendors/icheck/icheck.min.js',
'assets/vendors/bootstrap/js/bootstrap.min.js',
//'assets/vendors/bootstrap-switch/bootstrap-switch.min.js',
'assets/vendors/buttons/js/buttons.js',
'assets/lib/angularjs/1.3.9/ie8/angular.min.js',
//'assets/lib/dhtmlx/v403_pro/codebase/dhtmlx.js',
//'assets/lib/dhtmlx/v412_std/sources/dhtmlxTabbar/codebase/dhtmlxtabbar.js',
//'assets/lib/dhtmlx/dhtmlx.custom.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxCommon/codebase/dhtmlxcommon.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxCommon/codebase/dhtmlxcore.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxCommon/codebase/dhtmlxcontainer.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxLayout/codebase/dhtmlxlayout.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxAccordion/codebase/dhtmlxaccordion.js',
'assets/lib/dhtmlx/v412_std/sources/dhtmlxTabbar/codebase/dhtmlxtabbar.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxTree/codebase/dhtmlxtree.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxTree/codebase/ext/dhtmlxtree_json.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxToolbar/codebase/dhtmlxtoolbar.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxMenu/codebase/dhtmlxmenu.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/dhtmlxgrid.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_drag.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_export.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_filter.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_nxml.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_selection.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_srnd.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_validation.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_tree.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_link.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_grid.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_dhxcalendar.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_cntr.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_acheck.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_context.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_start.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_data.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_fast.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_filter_ext.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_form.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_group.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_hextra.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_hmenu.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_json.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_markers.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_math.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_mcol.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_over.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_pgn.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_post.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_rowspan.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_splt.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_ssc.js',
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_undo.js',
'assets/lib/dhtmlx/dhtmlx.custom.js',
'assets/lib/requirejs/require.min.js',
'app/main.js'
],
'build/ie.js':['assets/lib/ie/html5shiv/html5shiv.min.js',
'assets/lib/ie/es5-shim/es5-shim.min.js',
'assets/lib/ie/json/json3.min.js',
'assets/lib/ie/respond/respond.min.js',
'assets/lib/ie/ieupdate/ieupdate.js']
}
}
},
cssmin: {
concat: {
options: {
keepBreaks: true, // whether to keep line breaks (default is false)
keepSpecialComments: 0,
// debug: true, // set to true to get minification statistics under 'stats' property (see test/custom-test.js for examples)
noAdvanced: false, //, // set to true to disable advanced optimizations - selector & property merging, reduction, etc.
//relativeTo: 'http://www.baidu.com/', //'http://online-domain-tools.com/',
noRebase:false, // whether to skip URLs rebasing
root: './'
},
nonull: true,
src: [
'assets/css/default/scaffolding.css',
'assets/css/default/helpers.css',
'assets/vendors/buttons/css/buttons.min.css',
'assets/lib/dhtmlx/v412_std/skins/default/dhtmlx.css',
'app/css/app.css',
'app/css/fix.css',
'assets/css/default/icons.css'
],
dest: 'build/app.css'
},
minify: {
options: {},
nonull: true,
src: ['build/app.css'],
dest: 'build/app.css'
}
},
replace: {
another_example: {
src: ['build/app.css'],
overwrite: true, // overwrite matched source files
replacements: [{
from: /\/assets/g,
to: '/assets'
},
{
from:/\/app/g,
to:'/app'
}]
}
},
copy: {
main: {
files: [
//{src: ['assets/lib/dhtmlx/v412_std/codebase/dhtmlx.js'], dest: 'build/dhtmlx.js'},
//{src: ['assets/lib/angularjs/1.3.9/ie8/angular.min.js'], dest: 'build/angular.js'},
//{src: ['assets/lib/jquery/jquery-1.11.2.min.js'],dest:'build/jquery.js'},
{src: ['app/img/logo/chitu-32.png'], dest: 'build/app.png'}
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('default', ['uglify','cssmin:concat','replace', 'cssmin:minify','copy']);
};