Install del and update gulp to clean dist and tmp directories before build and test respectively.

This commit is contained in:
Matt Mazzola 2016-06-23 11:29:48 -07:00
Родитель 07c5810efd
Коммит 007428c15c
2 изменённых файлов: 17 добавлений и 1 удалений

Просмотреть файл

@ -1,5 +1,6 @@
var gulp = require('gulp-help')(require('gulp'));
var rename = require('gulp-rename'),
var del = require('del'),
rename = require('gulp-rename'),
replace = require('gulp-replace'),
uglify = require('gulp-uglify'),
karma = require('karma'),
@ -12,6 +13,7 @@ var rename = require('gulp-rename'),
gulp.task('build', 'Build for release', function (done) {
return runSequence(
'clean:dist',
'compile:ts',
'min',
'generatecustomdts',
@ -21,6 +23,7 @@ gulp.task('build', 'Build for release', function (done) {
gulp.task('test', 'Runs all tests', function (done) {
return runSequence(
'clean:tmp',
'compile:spec',
'test:js',
done
@ -42,6 +45,18 @@ gulp.task('min', 'Minify build files', function () {
.pipe(gulp.dest('./dist/'));
});
gulp.task('clean:dist', 'Clean dist folder', function () {
return del([
'./dist/**/*'
]);
});
gulp.task('clean:tmp', 'Clean tmp folder', function () {
return del([
'./tmp/**/*'
]);
});
gulp.task('compile:spec', 'Compile spec tests', function () {
return gulp.src(['./test/test.spec.ts'])
.pipe(webpack(webpackTestConfig))

Просмотреть файл

@ -26,6 +26,7 @@
"author": "Microsoft PowerBI Team",
"license": "MIT",
"devDependencies": {
"del": "^2.2.1",
"gulp": "^3.9.1",
"gulp-help": "^1.6.1",
"gulp-rename": "^1.2.2",