diff --git a/Makefile b/Makefile index 13ac9e4..f22de5c 100644 --- a/Makefile +++ b/Makefile @@ -2,11 +2,15 @@ jshint = node_modules/.bin/jshint mocha = node_modules/.bin/mocha browserify = node_modules/.bin/browserify bower = node_modules/.bin/bower +uglifyjs = node_modules/.bin/uglifyjs +test_min = ./test_min.sh npm = npm git = git all: jshint mocha test_client/assert.js bower_components +min: rssi.min.js test_min + node_modules: package.json @ $(npm) install @@ -22,5 +26,11 @@ test_client/assert.js: node_modules bower_components: node_modules bower.json @ $(bower) install +rssi.min.js: node_modules rssi.js + @ $(uglifyjs) rssi.js -c -m -o rssi.min.js + +test_min: node_modules rssi.min.js + @ $(test_min) + clean: @ $(git) clean -dfx diff --git a/package.json b/package.json index 6f250f0..8513791 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rssi", - "version": "0.0.4", + "version": "0.0.5", "description": "Ruby-like simple string interpolation", "keywords": ["interpolation", "string", "formatting", "template"], "author": "Mark Vasilkov (https://github.com/mvasilkov)", @@ -19,7 +19,8 @@ "jshint": "2.x", "mocha": "1.x", "browserify": "2.x", - "bower": "1.x" + "bower": "1.x", + "uglify-js": "2.x" }, "license": "MIT" } diff --git a/rssi.min.js b/rssi.min.js new file mode 100644 index 0000000..a9e27ec --- /dev/null +++ b/rssi.min.js @@ -0,0 +1 @@ +!function(){function n(n,e){return'"+(typeof obj["'+e+'"]!="undefined"?obj["'+e+'"]:"'+n+'")+"'}function e(e,t){if((!t||!t.noCache)&&e in o)return o[e];var f=JSON.stringify(e).replace(/#\{(.*?)\}/g,n);return o[e]=Function("obj","return "+f)}var o={};"undefined"!=typeof module&&module.exports?module.exports=e:"function"==typeof define&&define.amd?define(function(){return e}):"undefined"!=typeof window&&(window.fmt=e)}(); \ No newline at end of file diff --git a/test_min.sh b/test_min.sh new file mode 100755 index 0000000..2ed4b35 --- /dev/null +++ b/test_min.sh @@ -0,0 +1,7 @@ +#!/bin/bash +mv rssi.js _rssi.js +ln -s rssi.min.js rssi.js +make mocha +result=$? +mv _rssi.js rssi.js +exit $result