File tree Expand file tree Collapse file tree 4 files changed +38
-9
lines changed Expand file tree Collapse file tree 4 files changed +38
-9
lines changed Original file line number Diff line number Diff line change 1
1
* ~
2
2
node_modules /
3
+ public /draw.min.js
4
+ public /style.min.css
Original file line number Diff line number Diff line change 9
9
"jade" : " 1.6.x" ,
10
10
"socket.io" : " 1.0.6" ,
11
11
"redis" : " 0.12.x" ,
12
- "lzwcompress" : " 0.1.x"
12
+ "lzwcompress" : " 0.1.x" ,
13
+ "node-minify" : " 0.10.x"
13
14
},
14
15
"engines" : {
15
16
"node" : " 0.10.x" ,
Original file line number Diff line number Diff line change @@ -15,6 +15,38 @@ var localConnectedClients = 0;
15
15
var clients = { } ;
16
16
var netUsage = 0 ;
17
17
18
+ //compress all JS into one file on startup
19
+ new compressor . minify ( {
20
+ type : 'uglifyjs' ,
21
+ fileIn : [ 'public/socket.io-1.0.6.min.js' ,
22
+ 'public/alertify.min.js' ,
23
+ 'public/jquery.hammer.min.js' ,
24
+ 'public/lzwCompress.js' ,
25
+ 'public/draw.js'
26
+ ] ,
27
+ fileOut : 'public/draw.min.js' ,
28
+ callback : function ( err , min ) {
29
+ if ( err ) {
30
+ console . log ( err ) ;
31
+ }
32
+ }
33
+ } ) ;
34
+
35
+ //compress css
36
+ new compressor . minify ( {
37
+ type : 'clean-css' ,
38
+ fileIn : [ 'public/alertify.core.css' ,
39
+ 'public/alertify.default.css' ,
40
+ 'public/style.css'
41
+ ] ,
42
+ fileOut : 'public/style.min.css' ,
43
+ callback : function ( err , min ) {
44
+ if ( err ) {
45
+ console . log ( err ) ;
46
+ }
47
+ }
48
+ } ) ;
49
+
18
50
app . use ( express . compress ( ) ) ;
19
51
app . use ( express . static ( __dirname + '/public' , { maxAge : 60 * 60 * 24 * 1000 } ) ) ;
20
52
app . use ( express . logger ( ) ) ;
Original file line number Diff line number Diff line change 3
3
head
4
4
title Tim's Multiplayer Draw App
5
5
meta( name ="viewport" content ="initial-scale=1" )
6
- link( rel ="stylesheet" href ="style.css" )
7
- link( rel ="stylesheet" href ="alertify.core.css" )
8
- link( rel ="stylesheet" href ="alertify.default.css" )
6
+ link( rel ="stylesheet" href ="style.min.css" )
9
7
body
10
8
div#colourPanel
11
9
div#colourPanelTab C
39
37
p node-multidraw v0.5 by <a href =" http://timatooth.com" >Tim Sullivan</a >
40
38
p Source code on <a href =" https://github.com/timatooth/node-multidraw" >GitHub</a >
41
39
input( type ="text" id ="chatBox" placeholder ="Chat" maxlength ="135" )
42
- script( src ="socket.io-1.0.6.min.js" )
43
40
script( src ="http://code.jquery.com/jquery-2.1.1.min.js" )
44
- script( src ="jquery.hammer.min.js" )
45
- script( src ="alertify.min.js" )
46
- script( src ="lzwCompress.js" )
47
- script( src ="draw.js" )
41
+ script( src ="draw.min.js" )
48
42
You can’t perform that action at this time.
0 commit comments