This repository has been archived by the owner on Apr 28, 2024. It is now read-only.
forked from Freeboard/freeboard
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathGruntfile.js
183 lines (176 loc) · 7.28 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
css: {
src: [
'lib/css/thirdparty/*.css',
'lib/css/freeboard/styles.css',
'lib/css/thirdparty/fa/*.css'
],
dest: 'css/freeboard.css'
},
drayerdb : {
src : [
[
'lib/js/thirdparty/nano-sql.min.js',
'lib/js/thirdparty/nanosql.fuzzy.min.js',
'lib/js/thirdparty/nacl-fast.js',
'lib/js/thirdparty/blake2b.js',
'lib/js/thirdparty/structjsfork.js',
'lib/js/thirdparty/stable-stringify.js',
'lib/js/thirdparty/fflate.min.js',
'DrayerDB/drayerdb.js'
]
],
dest : 'js/drayerdb.standalone.js'
},
thirdparty : {
src : [
[
'lib/js/thirdparty/head.js',
'lib/js/thirdparty/jquery.js',
'lib/js/thirdparty/raphael.2.1.0.min.js',
'lib/js/thirdparty/gauge.min.js',
'lib/js/thirdparty/jquery.sparkline.min.js',
'lib/js/thirdparty/knockout.js',
'lib/js/thirdparty/underscore.js',
'lib/js/thirdparty/jquery.gridster.js',
'lib/js/thirdparty/jquery.caret.js',
'lib/js/thirdparty/jquery.xdomainrequest.js',
'lib/js/thirdparty/codemirror.js',
'lib/js/thirdparty/strftime.js',
'lib/js/thirdparty/js-yaml.js',
'lib/js/thirdparty/jsgrid.min.js',
'lib/js/thirdparty/math.min.js',
'lib/js/thirdparty/trumbowyg.js',
'lib/js/thirdparty/trumbowyg.fontsize.min.js',
'lib/js/thirdparty/trumbowyg.fontfamily.min.js',
'lib/js/thirdparty/trumbowyg.base64.min.js',
'lib/js/thirdparty/trumbowyg.table.min.js',
'lib/js/thirdparty/trumbowyg.preformatted.min.js',
'lib/js/thirdparty/trumbowyg.emoji.min.js',
'lib/js/thirdparty/trumbowyg.specialchars.min.js',
'lib/js/thirdparty/trumbowyg.resizeimg.min.js',
'lib/js/thirdparty/trumbowyg.colors.min.js',
'lib/js/thirdparty/mustache.min.js',
'lib/js/thirdparty/jquery-resizable.min.js',
'lib/js/thirdparty/nano-sql.min.js',
'lib/js/thirdparty/nanosql.fuzzy.min.js',
'lib/js/thirdparty/luxon.min.js',
'lib/js/thirdparty/keyboard.min.js',
'lib/js/thirdparty/jsoneditor.min.js',
'lib/js/thirdparty/vanillapicker.min.js',
'lib/js/thirdparty/howler.min.js',
'lib/js/thirdparty/leaflet.js',
'lib/js/thirdparty/day.min.js',
'lib/js/thirdparty/leaflet.tilelayer.fallback.js',
'lib/js/thirdparty/leaflet-realtime.js',
'lib/js/thirdparty/chroma.js',
'lib/js/thirdparty/spectrum.min.js',
'lib/js/thirdparty/print.min.js',
'lib/js/thirdparty/purify.js',
'lib/js/thirdparty/textFit.min.js',
'lib/js/thirdparty/nacl-fast.js',
'lib/js/thirdparty/filesaver.js',
'lib/js/thirdparty/blake2b.js',
'lib/js/thirdparty/structjsfork.js',
'lib/js/thirdparty/stable-stringify.js',
'lib/js/thirdparty/sparticles.js',
'lib/js/thirdparty/fflate.min.js',
'DrayerDB/drayerdb.js'
]
],
dest : 'js/freeboard.thirdparty.js'
},
fb : {
src : [
'lib/js/freeboard/DatasourceModel.js',
'lib/js/freeboard/DeveloperConsole.js',
'lib/js/freeboard/DialogBox.js',
'lib/js/freeboard/FreeboardModel.js',
'lib/js/freeboard/FreeboardUI.js',
'lib/js/freeboard/JSEditor.js',
'lib/js/freeboard/PaneModel.js',
'lib/js/freeboard/PluginEditor.js',
'lib/js/freeboard/ValueEditor.js',
'lib/js/freeboard/WidgetModel.js',
'lib/js/freeboard/freeboard.js',
'lib/js/freeboard/globalSettingsSchema.js',
'lib/js/freeboard/help.js'
],
dest : 'js/freeboard.js'
},
plugins : {
src : [
'plugins/freeboard/*.js'
],
dest : 'js/freeboard.plugins.js'
},
'fb_plugins' : {
src : [
'js/freeboard.js',
'js/freeboard.plugins.js'
],
dest : 'js/freeboard_plugins.js'
}
},
cssmin : {
css:{
src: 'css/freeboard.css',
dest: 'css/freeboard.min.css'
}
},
uglify : {
fb: {
files: {
'js/freeboard.min.js' : [ 'js/freeboard.js' ]
}
},
drayerdb: {
files: {
'js/drayerdb.standalone.min.js' : [ 'js/drayerdb.standalone.js' ]
}
},
plugins: {
files: {
'js/freeboard.plugins.min.js' : [ 'js/freeboard.plugins.js' ]
}
},
thirdparty :{
options: {
mangle : false,
beautify : false,
compress: {}
},
files: {
'js/freeboard.thirdparty.min.js' : [ 'js/freeboard.thirdparty.js' ]
}
},
'fb_plugins': {
files: {
'js/freeboard_plugins.min.js' : [ 'js/freeboard_plugins.js' ]
}
}
},
'string-replace': {
css: {
files: {
'css/': 'css/*.css'
},
options: {
replacements: [{
pattern: /..\/..\/..\/img/ig,
replacement: '../img'
}]
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify-es');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-string-replace');
grunt.registerTask('default', [ 'concat:css', 'cssmin:css', 'concat:fb', 'concat:thirdparty', 'concat:plugins', 'concat:fb_plugins', 'uglify:fb', 'uglify:plugins', 'uglify:fb_plugins', 'uglify:thirdparty', 'string-replace:css' ]);
};