From 42e7fc5252c4df3153eb4e07eae24bccfb62f615 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 24 Apr 2015 15:59:13 -0700 Subject: [PATCH] build(broccoli): add source-maps to our broccoli tools --- gulpfile.js | 18 +++++++++++++----- npm-shrinkwrap.clean.json | 3 +++ npm-shrinkwrap.json | 5 +++++ package.json | 1 + 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index c925a6b934..d1c66a66ed 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -8,6 +8,7 @@ var shell = require('gulp-shell'); var runSequence = require('run-sequence'); var madge = require('madge'); var merge = require('merge'); +var merge2 = require('merge2'); var path = require('path'); var Q = require('q'); @@ -623,16 +624,23 @@ gulp.task('build.dart', function(done) { gulp.task('build.broccoli.tools', function() { var tsResult = gulp.src('tools/broccoli/**/*.ts') + .pipe(sourcemaps.init()) .pipe(tsc({target: 'ES5', module: 'commonjs'})) .on('error', function() { console.log("ERROR: Broccoli tools failed to build."); process.exit(1); }); - return tsResult.js.pipe(gulp.dest('dist/broccoli')) - .on('end', function() { - var BroccoliBuilder = require('./dist/broccoli/broccoli_builder').BroccoliBuilder; - getBroccoli = function() { return BroccoliBuilder; }; - }); + + var destDir = gulp.dest('dist/broccoli'); + + return merge2([ + tsResult.js.pipe(sourcemaps.write('.')).pipe(destDir), + tsResult.js.pipe(destDir) + ]).on('end', function() { + var BroccoliBuilder = require('./dist/broccoli/broccoli_builder').BroccoliBuilder; + getBroccoli = function() { return BroccoliBuilder; }; + }); + }); gulp.task('broccoli.js.dev', ['build.broccoli.tools'], function() { diff --git a/npm-shrinkwrap.clean.json b/npm-shrinkwrap.clean.json index 662d32162f..a30b10aeaa 100644 --- a/npm-shrinkwrap.clean.json +++ b/npm-shrinkwrap.clean.json @@ -7938,6 +7938,9 @@ "merge": { "version": "1.2.0" }, + "merge2": { + "version": "0.3.5" + }, "minijasminenode2": { "version": "1.0.0", "dependencies": { diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0e84562f18..57b8762e44 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -12244,6 +12244,11 @@ "from": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz", "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz" }, + "merge2": { + "version": "0.3.5", + "from": "merge2@*", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-0.3.5.tgz" + }, "minijasminenode2": { "version": "1.0.0", "from": "minijasminenode2@>=1.0.0 <2.0.0", diff --git a/package.json b/package.json index d56c14e2dc..d5f0785bbf 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,7 @@ "lodash": "^2.4.1", "madge": "^0.5.0", "merge": "^1.2.0", + "merge2": "^0.3.5", "minijasminenode2": "^1.0.0", "minimatch": "^2.0.1", "minimist": "1.1.x",