Commit c2932337d931675e8d24fa83476df81cff6a8bdc

Authored by Eric Fernandez
1 parent 2e1c1db0c9
Exists in master

agrego tarea para elminar archivos postinstall

Showing 1 changed file with 6 additions and 0 deletions   Show diff stats
1 const templateCache = require('gulp-angular-templatecache'); 1 const templateCache = require('gulp-angular-templatecache');
2 const clean = require('gulp-clean'); 2 const clean = require('gulp-clean');
3 const concat = require('gulp-concat'); 3 const concat = require('gulp-concat');
4 const htmlmin = require('gulp-htmlmin'); 4 const htmlmin = require('gulp-htmlmin');
5 const rename = require('gulp-rename'); 5 const rename = require('gulp-rename');
6 const uglify = require('gulp-uglify'); 6 const uglify = require('gulp-uglify');
7 const gulp = require('gulp'); 7 const gulp = require('gulp');
8 const pump = require('pump'); 8 const pump = require('pump');
9 const jshint = require('gulp-jshint'); 9 const jshint = require('gulp-jshint');
10 const replace = require('gulp-replace'); 10 const replace = require('gulp-replace');
11 const connect = require('gulp-connect'); 11 const connect = require('gulp-connect');
12 12
13 var paths = { 13 var paths = {
14 srcJS: 'src/js/*.js', 14 srcJS: 'src/js/*.js',
15 srcViews: 'src/views/*.html', 15 srcViews: 'src/views/*.html',
16 tmp: 'tmp', 16 tmp: 'tmp',
17 dist: 'dist/' 17 dist: 'dist/'
18 }; 18 };
19 19
20 gulp.task('templates', ['clean'], function() { 20 gulp.task('templates', ['clean'], function() {
21 return pump( 21 return pump(
22 [ 22 [
23 gulp.src(paths.srcViews), 23 gulp.src(paths.srcViews),
24 htmlmin(), 24 htmlmin(),
25 templateCache('views.js', { 25 templateCache('views.js', {
26 module: 'focaCrearNotaPedido', 26 module: 'focaCrearNotaPedido',
27 root: '' 27 root: ''
28 }), 28 }),
29 gulp.dest(paths.tmp) 29 gulp.dest(paths.tmp)
30 ] 30 ]
31 ); 31 );
32 }); 32 });
33 33
34 gulp.task('uglify', ['templates'], function() { 34 gulp.task('uglify', ['templates'], function() {
35 return pump( 35 return pump(
36 [ 36 [
37 gulp.src([ 37 gulp.src([
38 paths.srcJS, 38 paths.srcJS,
39 'tmp/views.js' 39 'tmp/views.js'
40 ]), 40 ]),
41 concat('foca-crear-nota-pedido.js'), 41 concat('foca-crear-nota-pedido.js'),
42 replace('src/views/', ''), 42 replace('src/views/', ''),
43 gulp.dest(paths.tmp), 43 gulp.dest(paths.tmp),
44 rename('foca-crear-nota-pedido.min.js'), 44 rename('foca-crear-nota-pedido.min.js'),
45 uglify(), 45 uglify(),
46 gulp.dest(paths.dist) 46 gulp.dest(paths.dist)
47 ] 47 ]
48 ); 48 );
49 }); 49 });
50 50
51 gulp.task('clean', function(){ 51 gulp.task('clean', function(){
52 return gulp.src(['tmp', 'dist'], {read: false}) 52 return gulp.src(['tmp', 'dist'], {read: false})
53 .pipe(clean()); 53 .pipe(clean());
54 }); 54 });
55 55
56 gulp.task('pre-commit', function() { 56 gulp.task('pre-commit', function() {
57 return pump( 57 return pump(
58 [ 58 [
59 gulp.src(paths.srcJS), 59 gulp.src(paths.srcJS),
60 jshint('.jshintrc'), 60 jshint('.jshintrc'),
61 jshint.reporter('default'), 61 jshint.reporter('default'),
62 jshint.reporter('fail') 62 jshint.reporter('fail')
63 ] 63 ]
64 ); 64 );
65 65
66 gulp.start('uglify'); 66 gulp.start('uglify');
67 }); 67 });
68 68
69 gulp.task('webserver', function() { 69 gulp.task('webserver', function() {
70 pump [ 70 pump [
71 connect.server({port: 3000}) 71 connect.server({port: 3000})
72 ] 72 ]
73 }); 73 });
74 74
75 gulp.task('clean-post-install', function() {
76 return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js',
77 'index.html'], {read: false})
78 .pipe(clean());
79 });
80
75 gulp.task('default', ['webserver']); 81 gulp.task('default', ['webserver']);
76 82