improve gulpfile
This commit is contained in:
parent
e44511383c
commit
fe5df281b5
2 changed files with 12 additions and 9 deletions
19
gulpfile.js
19
gulpfile.js
|
@ -12,7 +12,7 @@ options.sourceRoot = path.join(__dirname, 'src');
|
||||||
|
|
||||||
var compilation = tsb.create(options);
|
var compilation = tsb.create(options);
|
||||||
|
|
||||||
var compile = function () {
|
function compile() {
|
||||||
var ts = filter('**/*.ts', { restore: true });
|
var ts = filter('**/*.ts', { restore: true });
|
||||||
var input = es.merge(
|
var input = es.merge(
|
||||||
gulp.src('src/**', { base: 'src', dot: true }),
|
gulp.src('src/**', { base: 'src', dot: true }),
|
||||||
|
@ -24,17 +24,20 @@ var compile = function () {
|
||||||
.pipe(compilation())
|
.pipe(compilation())
|
||||||
.pipe(ts.restore)
|
.pipe(ts.restore)
|
||||||
.pipe(gulp.dest('out'));
|
.pipe(gulp.dest('out'));
|
||||||
};
|
}
|
||||||
|
|
||||||
gulp.task('clean', function (cb) { rimraf('out', cb); });
|
gulp.task('clean', function (cb) { rimraf('out', cb); });
|
||||||
gulp.task('compile', ['clean'], compile);
|
gulp.task('compile', ['clean'], compile);
|
||||||
gulp.task('compile-only', compile);
|
gulp.task('just-compile', compile);
|
||||||
|
|
||||||
gulp.task('test', function (cb) {
|
function test(cb) {
|
||||||
var child = cp.spawn('mocha', ['--reporter=dot'], { stdio: 'inherit' });
|
var child = cp.spawn('mocha', [], { stdio: 'inherit' });
|
||||||
child.on('exit', function (code) { cb(); });
|
child.on('exit', function (code) { cb(); });
|
||||||
});
|
}
|
||||||
|
|
||||||
gulp.task('watch', ['compile', 'test'], function () {
|
gulp.task('test', ['compile'], test);
|
||||||
gulp.watch(['src/**', 'typings/**'], ['compile-only', 'test']);
|
gulp.task('just-test', ['just-compile'], test);
|
||||||
|
|
||||||
|
gulp.task('watch', ['test'], function () {
|
||||||
|
gulp.watch(['src/**', 'typings/**'], ['just-test']);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
--require source-map-support/register out/test
|
--reporter=dot --require source-map-support/register out/test
|
Loading…
Add table
Reference in a new issue