Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Build script also gzips by default

  • Loading branch information...
commit ca7bfc154ad9731512ba55ec6b174de3cd3ea9d6 1 parent f761bba
@jnicklas jnicklas authored
Showing with 10 additions and 5 deletions.
  1. +8 −4 build.coffee
  2. +2 −1  package.json
View
12 build.coffee
@@ -3,13 +3,14 @@
CoffeeScript = require 'coffee-script'
fs = require 'fs'
path = require 'path'
+gzip = require 'gzip'
header = """
/**
* Serenade.js JavaScript Framework v#{Serenade.VERSION}
* http://github.com/elabs/serenade.js
*
- * Copyright 2011, Jonas Nicklas
+ * Copyright 2011, Jonas Nicklas, Elabs AB
* Released under the MIT License
*/
"""
@@ -47,10 +48,13 @@ Build =
} else { root.Serenade = Serenade }
}(this));
"""
- if process.env.MINIFY is 'true'
- {parser, uglify} = require 'uglify-js'
- code = uglify.gen_code uglify.ast_squeeze uglify.ast_mangle parser.parse code
+ {parser, uglify} = require 'uglify-js'
+ minified = uglify.gen_code uglify.ast_squeeze uglify.ast_mangle parser.parse code
fs.writeFileSync 'extras/serenade.js', header + '\n' + code
+ fs.writeFileSync 'extras/serenade.min.js', header + '\n' + minified
+ gzip (header + '\n' + minified), (err, data) ->
+ fs.writeFileSync 'extras/serenade.min.js.gz', data
+
all: ->
Build.files()
Build.parser()
View
3  package.json
@@ -37,7 +37,8 @@
"coffee-script": "1.2.0",
"sinon": "1.2.0",
"uglify-js": "1.2.3",
- "express": "2.5.2"
+ "express": "2.5.2",
+ "gzip": "0.1.0"
},
"scripts": {
"build": "cake build",
Please sign in to comment.
Something went wrong with that request. Please try again.