diff --git a/lib/index.js b/lib/index.js index cc8768b..45b0400 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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; diff --git a/package.json b/package.json index 32b795c..be1a8b4 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/test/index.js b/test/index.js index fb93595..d0902e5 100644 --- a/test/index.js +++ b/test/index.js @@ -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); @@ -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); @@ -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() { @@ -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(); @@ -321,4 +321,4 @@ describe('gulp-es6-module-transpiler', function() { }); }); }); -}); +}); \ No newline at end of file