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