chore: source maps for Karma/Gulp

For Karma, the source mapa are inlined inside each source file.
For `build/*` output, separate `*.map` file is created.

This changes the API of `tools/transpiler/index.js`. I believe this API
is only used in `gulp-traceur.js` and `karma-traceur-preprocessor.js`.
Instead of returning the transpiled string, `compile()` returns a result
object such as:
```js
{
  js: ‘transpiled code’,
  sourceMap: null || {}
}
```

Closes #20
This commit is contained in:
Vojta Jina
2014-10-30 18:52:32 +01:00
parent 18cdab7450
commit 1dc5a22f07
6 changed files with 56 additions and 6 deletions

View File

@ -20,6 +20,7 @@ var through2 = require('through2');
var watch = require('gulp-watch');
var js2es5Options = {
sourceMaps: true,
annotations: true, // parse annotations
types: true, // parse types
script: false, // parse as a module
@ -36,6 +37,7 @@ var js2es5OptionsDev = merge(true, js2es5Options, {
});
var js2dartOptions = {
sourceMaps: true,
annotations: true, // parse annotations
types: true, // parse types
script: false, // parse as a module