chore(gulp-traceur): better error reporting

Use original filename when printing errors (instead of the output).
This commit is contained in:
Vojta Jina 2014-11-05 11:42:23 -08:00
parent 9dd7cae9fd
commit 7d0a83a24c
1 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ function gulpTraceur(options, resolveModuleName) {
var originalFilePath = file.history[0];
var moduleName = resolveModuleName ? resolveModuleName(file.relative) : null;
var result = compiler.compile(options, {
inputPath: file.relative,
inputPath: originalFilePath,
outputPath: file.relative,
moduleName: moduleName
}, file.contents.toString());
@ -46,7 +46,7 @@ function gulpTraceur(options, resolveModuleName) {
done();
} catch (errors) {
if (errors.join) {
throw new Error('gulp-traceur: '+errors.join('\n'));
throw new Error('gulp-traceur:\n ' + errors.join('\n '));
} else {
console.error('Error when transpiling:\n ' + originalFilePath);
throw errors;