jnordberg/coffeeify — pull request #18 by tepez (2014-04-23 11:36:43+00:00)
Title: make source maps optional

Makes source maps optional:
```
browserify -t coffeeify/no-debug ...
```
Or:
```
var transform = require('coffeeify');
transform.sourceMap = false;
```
Closes https://github.com/jnordberg/coffeeify/issues/12

One of the tests is failing and it's failing even before these changes. I couldn't understand why it fails. Can you take a look?

```
not ok test/transform.js ................................ 2/3
Command: "C:\Program Files\nodejs\node.exe transform.js"
TAP version 13
not ok 1 adds sourcemap comment including original source
---
file: stream.js
line: 79
column: 10
stack:
- getCaller (F:\Tom\Code\GitHub\coffeeify\node_modules\tap\lib\tap-assert.js:418:17)
- assert (F:\Tom\Code\GitHub\coffeeify\node_modules\tap\lib\tap-assert.js:21:16)
- Function.equivalent (F:\Tom\Code\GitHub\coffeeify\node_modules\tap\lib\tap-assert.js:182:12)
- Test._testAssert (F:\Tom\Code\GitHub\coffeeify\node_modules\tap\lib\tap-test.js:87:16)
- Stream.end (F:\Tom\Code\GitHub\coffeeify\test\transform.js:23:11)
- _end (F:\Tom\Code\GitHub\coffeeify\node_modules\through\index.js:65:9)
- Stream.stream.end (F:\Tom\Code\GitHub\coffeeify\node_modules\through\index.js:74:5)
- Stream.onend (stream.js:79:10)
- Stream.EventEmitter.emit (events.js:117:20)
- drain (F:\Tom\Code\GitHub\coffeeify\node_modules\through\index.js:34:23)
- Stream.stream.queue.stream.push (F:\Tom\Code\GitHub\coffeeify\node_modules\through\index.js:45:5)
- F:\Tom\Code\GitHub\coffeeify\index.js:88:14
- compile (F:\Tom\Code\GitHub\coffeeify\index.js:67:5)
- Stream.end (F:\Tom\Code\GitHub\coffeeify\index.js:85:5)
- _end (F:\Tom\Code\GitHub\coffeeify\node_modules\through\index.js:65:9)
- Stream.stream.end (F:\Tom\Code\GitHub\coffeeify\node_modules\through\index.js:74:5)
- ReadStream.onend (_stream_readable.js:483:10)
- ReadStream.g (events.js:180:16)
- ReadStream.EventEmitter.emit (events.js:117:20)
- _stream_readable.js:920:16
- process._tickCallback (node.js:415:13)
-
found:
version: 3
file: F:\Tom\Code\GitHub\coffeeify\example\foo.coffee
sourceRoot:
sources:
- F:\Tom\Code\GitHub\coffeeify\example\foo.coffee
names:
-
mappings: AAAA,OAAO,CAAC,GAAR,CAAY,OAAA,CAAQ,UAAR,CAAZ,CAAA,CAAA
sourcesContent:
- console.log(require './bar.js')
wanted:
version: 3
file: F:\Tom\Code\GitHub\coffeeify\example\foo.coffee
sourceRoot:
sources:
- F:\Tom\Code\GitHub\coffeeify\example\foo.coffee
names:
-
mappings: AAAA,OAAO,CAAC,GAAR,CAAY,OAAA,CAAQ,UAAR,CAAZ,CAAA,CAAA
sourcesContent:
- console.log(require './bar.js')
diff: |
{
"version" : 3,
"file" : "F:\Tom\Code\GitHub\coffeeify\example\foo.coffee",
"sourceRoot" : "",
"sources" : [
"F:\Tom\Code\GitHub\coffeeify\example\foo.coffee"
],
"names" : [

],
"mappings" : "AAAA,OAAO,CAAC,GAAR,CAAY,OAAA,CAAQ,UAAR,CAAZ,CAAA,CAAA",
"sourcesContent" : [
"console.log(require './bar.js')
" // != "console.log(require './bar.js')
"
]
}
```