Commit 3d03ae981efbc5d27fb3e57b0a7be2e06dc4e218

Authored by Eric
1 parent 192accea06
Exists in master and in 1 other branch develop

gulp

Showing 1 changed file with 19 additions and 1 deletions   Show diff stats
... ... @@ -9,6 +9,9 @@ const pump = require('pump');
9 9 const jshint = require('gulp-jshint');
10 10 const replace = require('gulp-replace');
11 11 const connect = require('gulp-connect');
  12 +const header = require('gulp-header');
  13 +const footer = require('gulp-footer');
  14 +const gulpSequence = require('gulp-sequence');
12 15  
13 16 var paths = {
14 17 srcJS: 'src/js/*.js',
... ... @@ -18,6 +21,8 @@ var paths = {
18 21 dist: 'dist/'
19 22 };
20 23  
  24 +gulp.task('uglify', gulpSequence('clean', ['templates', 'uglify-spec'], 'uglify-app'));
  25 +
21 26 gulp.task('templates', ['clean'], function() {
22 27 return pump(
23 28 [
... ... @@ -32,7 +37,7 @@ gulp.task('templates', ['clean'], function() {
32 37 );
33 38 });
34 39  
35   -gulp.task('uglify', ['templates'], function() {
  40 +gulp.task('uglify-app', function() {
36 41 return pump(
37 42 [
38 43 gulp.src([
... ... @@ -49,6 +54,19 @@ gulp.task('uglify', ['templates'], function() {
49 54 );
50 55 });
51 56  
  57 +gulp.task('uglify-spec', function() {
  58 + return pump(
  59 + [
  60 + gulp.src(paths.specs),
  61 + concat('foca-crear-remito.spec.js'),
  62 + replace('src/views/', ''),
  63 + header("describe('Módulo foca-crear-remito', function() { \n"),
  64 + footer("});"),
  65 + gulp.dest(paths.dist)
  66 + ]
  67 + );
  68 +});
  69 +
52 70 gulp.task('clean', function() {
53 71 return gulp.src(['tmp', 'dist'], {read: false})
54 72 .pipe(clean());