Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ var sourceMap = require('vinyl-sourcemaps-apply');
var transpiler = require('es6-module-transpiler');
var path = require('path');

// this is dirty, I know - however, installing an own version
// of reacast can lead to errors because of gulp-es6mt and
// es6-module-transpiler using different instances of recast
var recast = require('es6-module-transpiler/node_modules/recast');
var recast = require('recast');

var FileResolver = transpiler.FileResolver;

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"es6-module-transpiler": "^0.10.0",
"gulp-util": "^3.0.1",
"through2": "^0.6.1",
"vinyl-sourcemaps-apply": "^0.1.1"
"vinyl-sourcemaps-apply": "^0.1.1",
"recast": "^0.11.3"
},
"devDependencies": {
"del": "^1.1.1",
Expand Down
16 changes: 8 additions & 8 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('gulp-es6-module-transpiler', function() {
callback(error);
});

stream.on('data', function (file) {
stream.on('data', function(file) {
expect(file).to.be.ok();

callback(null, file);
Expand All @@ -73,6 +73,10 @@ describe('gulp-es6-module-transpiler', function() {
stream.end();
}

function toString(file) {
return file.contents.toString('utf8');
}

function verify(transpileOptions, makeOptions, callback) {
transpile(transpileOptions, function(error, output) {
expect(error).to.be(null);
Expand All @@ -82,10 +86,6 @@ describe('gulp-es6-module-transpiler', function() {
});
}

function toString(file) {
return file.contents.toString('utf8');
}

var inputs = load(inputDir);

describe('options', function() {
Expand Down Expand Up @@ -238,12 +238,12 @@ describe('gulp-es6-module-transpiler', function() {
expect(error).to.be(null);
expect(output.sourceMap).to.eql({
version: 3,
sources: [ 'default.js' ],
sources: ['default.js'],
names: [],
mappings: ';;IAAA,CAAC,CAAC,kBAAS,EAAE,CAAC,CAAC,CAAC' +
',CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC',
file: 'default',
sourcesContent: [ inputs.default.contents.toString('utf8') ]
sourcesContent: [inputs.default.contents.toString('utf8')]
});

done();
Expand Down Expand Up @@ -321,4 +321,4 @@ describe('gulp-es6-module-transpiler', function() {
});
});
});
});
});