Skip to content
Permalink
Browse files

Updated gulpfile to v4

  • Loading branch information...
Vincent Prouillet
Vincent Prouillet committed Mar 13, 2015
1 parent ef30315 commit 91a05401c6ea532467bc00b5a6e54fd95b6b0eaf
Showing with 17 additions and 17 deletions.
  1. +15 −14 gulpfile.js
  2. +2 −3 package.json
@@ -3,7 +3,6 @@ var plugins = require('gulp-load-plugins')();
var del = require('del');
plugins.ngAnnotate = require('gulp-ng-annotate');

var runSequence = require('run-sequence');
var browserSync = require('browser-sync');


@@ -100,7 +99,7 @@ gulp.task('ts-compile', function () {
.pipe(plugins.typescript(tsProject));

return tsResult.js.pipe(isDist ? plugins.concat('app.js') : plugins.util.noop())
.pipe(plugins.ngAnnotate())
.pipe(plugins.ngAnnotate({gulpWarnings: false}))
.pipe(isDist ? plugins.uglify() : plugins.util.noop())
.pipe(plugins.wrap({ src: './iife.txt'}))
.pipe(gulp.dest(destinations.js));
@@ -133,13 +132,13 @@ gulp.task('karma-watch', function () {

gulp.task('webdriver_update', plugins.protractor.webdriver_update);

gulp.task('protractor', ['webdriver_update'], function () {
gulp.task('protractor', function () {
return gulp.src(globs.integration)
.pipe(plugins.protractor.protractor({configFile: 'protractor.conf.js'}));
});

gulp.task('browser-sync', function () {
return browserSync.init(null, {
return browserSync({
open: false,
server: {
baseDir: "./build"
@@ -172,7 +171,7 @@ gulp.task('index', function () {
).pipe(gulp.dest(destinations.index));
});

gulp.task('watch', ['browser-sync'], function () {
gulp.task('watch', function() {
gulp.watch(globs.sass, ['sass']);
gulp.watch(globs.appWithDefinitions, ['ts-lint', 'ts-compile']);
gulp.watch(globs.templates, ['templates']);
@@ -181,19 +180,21 @@ gulp.task('watch', ['browser-sync'], function () {

gulp.watch('build/**/*', function (file) {
if (file.type === "changed") {
return browserSync.reload(file.path);
return browserSync.reload({stream: true});
}
});
});

gulp.task('build', function () {
return runSequence(
gulp.task(
'build',
gulp.series(
'clean',
['sass', 'copy-assets', 'ts-compile', 'templates', 'copy-vendor'],
gulp.parallel('sass', 'copy-assets', 'ts-compile', 'templates', 'copy-vendor'),
'index'
);
});
)
);

gulp.task('default', ['build'], function () {
return runSequence(['watch', 'karma-watch']);
});
gulp.task(
'default',
gulp.series('build', 'browser-sync', gulp.parallel('watch', 'karma-watch'))
);
@@ -10,6 +10,7 @@
"browser-sync": "^2.2.3",
"chai": "^2.1.1",
"chai-as-promised": "^4.1.1",
"del": "^1.0.0",
"gulp": "gulpjs/gulp.git#4.0",
"gulp-autoprefixer": "2.1.0",
"gulp-concat": "^2.4.2",
@@ -20,8 +21,7 @@
"gulp-ng-annotate": "^0.5.2",
"gulp-ng-html2js": "^0.2.0",
"gulp-protractor": "0.0.11",
"del": "^1.0.0",
"gulp-sass": "^1.2.0",
"gulp-sass": "git://github.com/Keats/gulp-sass",
"gulp-tslint": "^1.4.1",
"gulp-typescript": "^2.3.0",
"gulp-uglify": "^1.0.1",
@@ -34,7 +34,6 @@
"karma-typescript-preprocessor": "^0.0.16",
"mocha": "^2.0.0",
"protractor": "^1.4.0",
"run-sequence": "^1.0.1",
"sinon": "^1.12.1",
"sinon-chai": "^2.6.0",
"typescript": "^1.3.0"

0 comments on commit 91a0540

Please sign in to comment.
You can’t perform that action at this time.