-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: option to use nodejs streams #23
Comments
If it turns out that implementing streams is going to be too much work, IMO it would still be very useful to be able to pass a callback to the |
Gulp/streams support would be awesome 👍 |
I think this enhancement is a "nice to have" but not necessary. I'm using var gulp = require('gulp');
var ts = require('gulp-typescript');
var merge = require('merge2');
var concat = require('gulp-concat');
var sourcemaps = require('gulp-sourcemaps');
var runSequence = require('run-sequence');
var del = require('del');
var dtsBundle = require('dts-bundle');
var tsProject = ts.createProject('tsconfig.json');
gulp.task('compile', function() {
var tsResult = tsProject.src() // instead of gulp.src(...)
.pipe(ts(tsProject));
return merge([
tsResult.dts.pipe(gulp.dest('dist/dts')),
tsResult.js.pipe(gulp.dest('dist/js'))
]);
});
gulp.task('bundle', function() {
var es5 = gulp.src('dist/js/src/**/*.js')
.pipe(sourcemaps.init())
.pipe(concat('Ng2Emulation-es5.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('dist/release'));
return es5;
});
gulp.task('clean', function(){
del([
'./dist'
]);
});
gulp.task('definition-bundle', function(){
dtsBundle.bundle({
name: 'Ng2Emulation',
main: 'dist/dts/src/Ng2Emulation.d.ts',
out: "dist/release/Ng2Emulation.d.ts",
exclude: /.*typings.*/,
verbose: true
});
});
gulp.task('build', function(done) {
runSequence('clean', 'compile', 'bundle', 'definition-bundle', done);
}); I have Any way, I think this will be a "nice to have" enhacement, of course, but not necessary. |
Thanks for developing this. Finding it extremely useful in a project for untangling the madness that is the process of bundling a TypeScript lib for node with generated d.ts files.
One thing that would make things easier for integrating dts-bundle into build scripts is an option to use node streams:
@Bartvds Is this a good idea? Would it be a pain to implement (I haven't taken a look at how dts-bundle is implemented)? I'm happy to take a stab at it.
The text was updated successfully, but these errors were encountered: