Commit c8b9e588693ceaf395c70f3dfdfd0e1eff8a300c
1 parent
cef91ce45f
Exists in
master
elimino modulo en gulpfile
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
gulpfile.js
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 | replace('"ngRoute","ui.bootstrap","focaModalVendedores","focaBusquedaProductos",'+ | 46 | replace('"ngRoute","ui.bootstrap","focaModalVendedores","focaBusquedaProductos",'+ |
47 | '"focaModalProveedor","focaBusquedaCliente","focaModalPrecioCondicion",'+ | 47 | '"focaModalProveedor","focaBusquedaCliente","focaModalPrecioCondicion",'+ |
48 | '"focaModalFlete","focaDirectivas","focaModal","focaModalDomicilio",'+ | 48 | '"focaModalFlete","focaDirectivas","focaModal","focaModalDomicilio",'+ |
49 | '"focaModalMoneda","focaModalCotizacion","focaSeguimiento","angular-ladda",'+ | 49 | '"focaModalMoneda","focaModalCotizacion","focaSeguimiento","focaBotoneraLateral","angular-ladda",'+ |
50 | '"cordovaGeolocationModule"', ''), | 50 | '"cordovaGeolocationModule"', ''), |
51 | gulp.dest(paths.dist) | 51 | gulp.dest(paths.dist) |
52 | ] | 52 | ] |
53 | ); | 53 | ); |
54 | }); | 54 | }); |
55 | 55 | ||
56 | gulp.task('clean', function() { | 56 | gulp.task('clean', function() { |
57 | return gulp.src(['tmp', 'dist'], {read: false}) | 57 | return gulp.src(['tmp', 'dist'], {read: false}) |
58 | .pipe(clean()); | 58 | .pipe(clean()); |
59 | }); | 59 | }); |
60 | 60 | ||
61 | gulp.task('pre-commit', function() { | 61 | gulp.task('pre-commit', function() { |
62 | return pump( | 62 | return pump( |
63 | [ | 63 | [ |
64 | gulp.src(paths.srcJS), | 64 | gulp.src(paths.srcJS), |
65 | jshint('.jshintrc'), | 65 | jshint('.jshintrc'), |
66 | jshint.reporter('default'), | 66 | jshint.reporter('default'), |
67 | jshint.reporter('fail') | 67 | jshint.reporter('fail') |
68 | ] | 68 | ] |
69 | ); | 69 | ); |
70 | 70 | ||
71 | gulp.start('uglify'); | 71 | gulp.start('uglify'); |
72 | }); | 72 | }); |
73 | 73 | ||
74 | gulp.task('webserver', function() { | 74 | gulp.task('webserver', function() { |
75 | pump [ | 75 | pump [ |
76 | connect.server({port: 3300, host: '0.0.0.0'}) | 76 | connect.server({port: 3300, host: '0.0.0.0'}) |
77 | ] | 77 | ] |
78 | }); | 78 | }); |
79 | 79 | ||
80 | gulp.task('clean-post-install', function() { | 80 | gulp.task('clean-post-install', function() { |
81 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 81 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
82 | 'index.html'], {read: false}) | 82 | 'index.html'], {read: false}) |
83 | .pipe(clean()); | 83 | .pipe(clean()); |
84 | }); | 84 | }); |
85 | 85 | ||
86 | gulp.task('default', ['webserver']); | 86 | gulp.task('default', ['webserver']); |
87 | 87 | ||
88 | gulp.task('watch', function() { | 88 | gulp.task('watch', function() { |
89 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); | 89 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); |
90 | }); | 90 | }); |
91 | 91 | ||
92 | gulp.task('copy', ['uglify'], function() { | 92 | gulp.task('copy', ['uglify'], function() { |
93 | return gulp.src('dist/*.js') | 93 | return gulp.src('dist/*.js') |
94 | .pipe(gulp.dest('../../wrapper-demo/node_modules/foca-crear-nota-pedido/dist/')); | 94 | .pipe(gulp.dest('../../wrapper-demo/node_modules/foca-crear-nota-pedido/dist/')); |
95 | }); | 95 | }); |
96 | 96 | ||
97 | gulp.task('watchAndCopy', function() { | 97 | gulp.task('watchAndCopy', function() { |
98 | return gulp.watch([paths.srcJS], ['copy']); | 98 | return gulp.watch([paths.srcJS], ['copy']); |
99 | }); | 99 | }); |
100 | 100 |