Skip to content

Commit 7712810

Browse files
author
Alexander Kern
committed
Uglify and tests now work. hurrah!
1 parent 8a50034 commit 7712810

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

Cakefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
fs = require 'fs'
2+
uglify = require('uglify-js').uglify
23
{spawn, exec} = require 'child_process'
34

45
directories =
@@ -12,7 +13,6 @@ commands =
1213
build: "coffee -cb -o #{directories.build} #{directories.lib}"
1314
watch: "coffee -cbw -o #{directories.build} #{directories.lib}"
1415
test: "expresso --include #{directories.lib} #{directories.test}/*"
15-
min: (original, minified) -> "uglifyjs -o #{minified} #{original}"
1616

1717
# Use the npm bin directory.
1818
process.env['PATH'] = "node_modules/.bin:#{process.env['PATH']}"
@@ -57,7 +57,8 @@ task 'min', 'minify the compiled JavaScript files', ->
5757
walkBuildFiles (original) ->
5858
console.log("Minifying: #{original}...")
5959
minified = original.replace('.js', '.min.js')
60-
exec(commands.min(original, minified))
60+
fs.readFile original, (err, data) ->
61+
fs.writeFile(minified, uglify(data.toString()))
6162

6263
task 'test', 'run all tests', ->
6364
replaceProcess(commands.test)

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"coffee-script": "~ 1.0"
66
},
77
"devDependencies": {
8-
"expresso": ""
8+
"expresso": "",
9+
"uglify-js": "https://github.com/CapnKernul/UglifyJS/tarball/master"
910
},
1011
"engines": {
1112
"node": "*"

test/test_truth.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
assert = require 'assert'
2+
3+
module.exports =
4+
testTruth: ->
5+
assert.ok(true)

test/truth.test.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)