Commit 50d198324ab2d58b64687a1f4dc1664db97427d4

Authored by Eric Fernandez
1 parent 81030d6cdd
Exists in master

quito inyecciones

Showing 2 changed files with 1 additions and 7 deletions   Show diff stats
1 const templateCache = require('gulp-angular-templatecache'); 1 const templateCache = require('gulp-angular-templatecache');
2 const concat = require('gulp-concat'); 2 const concat = require('gulp-concat');
3 const htmlmin = require('gulp-htmlmin'); 3 const htmlmin = require('gulp-htmlmin');
4 const rename = require('gulp-rename'); 4 const rename = require('gulp-rename');
5 const uglify = require('gulp-uglify-es').default; 5 const uglify = require('gulp-uglify-es').default;
6 const gulp = require('gulp'); 6 const gulp = require('gulp');
7 const pump = require('pump'); 7 const pump = require('pump');
8 const jshint = require('gulp-jshint'); 8 const jshint = require('gulp-jshint');
9 const replace = require('gulp-replace'); 9 const replace = require('gulp-replace');
10 const connect = require('gulp-connect'); 10 const connect = require('gulp-connect');
11 const clean = require('gulp-clean'); 11 const clean = require('gulp-clean');
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('clean', function(){ 20 gulp.task('clean', function(){
21 return gulp.src(['tmp', 'dist'], {read: false}) 21 return gulp.src(['tmp', 'dist'], {read: false})
22 .pipe(clean()); 22 .pipe(clean());
23 }); 23 });
24 24
25 gulp.task('templates', ['clean'], function() { 25 gulp.task('templates', ['clean'], function() {
26 return pump( 26 return pump(
27 [ 27 [
28 gulp.src(paths.srcViews), 28 gulp.src(paths.srcViews),
29 htmlmin(), 29 htmlmin(),
30 templateCache('views.js', { 30 templateCache('views.js', {
31 module: 'focaBusquedaCliente', 31 module: 'focaBusquedaCliente',
32 root: '' 32 root: ''
33 }), 33 }),
34 gulp.dest(paths.tmp) 34 gulp.dest(paths.tmp)
35 ] 35 ]
36 ); 36 );
37 }); 37 });
38 38
39 gulp.task('uglify', ['templates'], function() { 39 gulp.task('uglify', ['templates'], function() {
40 return pump( 40 return pump(
41 [ 41 [
42 gulp.src([ 42 gulp.src([
43 paths.srcJS, 43 paths.srcJS,
44 'tmp/views.js' 44 'tmp/views.js'
45 ]), 45 ]),
46 concat('foca-busqueda-cliente.js'), 46 concat('foca-busqueda-cliente.js'),
47 replace("['ui.bootstrap', 'focaDirectivas', 'angular-ladda']", '[]'),
48 replace('src/views/', ''), 47 replace('src/views/', ''),
49 gulp.dest(paths.tmp), 48 gulp.dest(paths.tmp),
50 rename('foca-busqueda-cliente.min.js'), 49 rename('foca-busqueda-cliente.min.js'),
51 uglify(), 50 uglify(),
52 gulp.dest(paths.dist) 51 gulp.dest(paths.dist)
53 ] 52 ]
54 ); 53 );
55 }); 54 });
56 55
57 gulp.task('pre-commit', function() { 56 gulp.task('pre-commit', function() {
58 return pump( 57 return pump(
59 [ 58 [
60 gulp.src(paths.srcJS), 59 gulp.src(paths.srcJS),
61 jshint('.jshintrc'), 60 jshint('.jshintrc'),
62 jshint.reporter('default'), 61 jshint.reporter('default'),
63 jshint.reporter('fail') 62 jshint.reporter('fail')
64 ] 63 ]
65 ); 64 );
66 }); 65 });
67 66
68 67
69 gulp.task('webserver', function() { 68 gulp.task('webserver', function() {
70 pump [ 69 pump [
71 connect.server({port: 3000}) 70 connect.server({port: 3000})
72 ] 71 ]
73 }); 72 });
74 73
75 gulp.task('clean-post-install', function() { 74 gulp.task('clean-post-install', function() {
76 return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', 75 return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js',
77 'index.html'], {read: false}) 76 'index.html'], {read: false})
78 .pipe(clean()); 77 .pipe(clean());
79 }); 78 });
80 79
81 gulp.task('default', ['webserver']); 80 gulp.task('default', ['webserver']);
82 81
83 gulp.task('watch', function(){ 82 gulp.task('watch', function(){
84 gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); 83 gulp.watch([paths.srcJS, paths.srcViews], ['uglify']);
85 }); 84 });
86 85
1 angular.module('focaBusquedaCliente', [ 1 angular.module('focaBusquedaCliente', []);
2 'ui.bootstrap',
3 'focaDirectivas',
4 'angular-ladda',
5 'focaModal'
6 ]);
7 2