Commit 780da56fbdebece6256263b5aa5fa674e4a316a3
1 parent
6ab904e618
Exists in
master
elmino inyección para script minificado
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 | '"focaModalPetroleras","focaBusquedaCliente"', ''), | 47 | '"focaModalPetroleras","focaBusquedaCliente","focaModalPrecioCondicion"', ''), |
48 | gulp.dest(paths.dist) | 48 | gulp.dest(paths.dist) |
49 | ] | 49 | ] |
50 | ); | 50 | ); |
51 | }); | 51 | }); |
52 | 52 | ||
53 | gulp.task('clean', function(){ | 53 | gulp.task('clean', function(){ |
54 | return gulp.src(['tmp', 'dist'], {read: false}) | 54 | return gulp.src(['tmp', 'dist'], {read: false}) |
55 | .pipe(clean()); | 55 | .pipe(clean()); |
56 | }); | 56 | }); |
57 | 57 | ||
58 | gulp.task('pre-commit', function() { | 58 | gulp.task('pre-commit', function() { |
59 | return pump( | 59 | return pump( |
60 | [ | 60 | [ |
61 | gulp.src(paths.srcJS), | 61 | gulp.src(paths.srcJS), |
62 | jshint('.jshintrc'), | 62 | jshint('.jshintrc'), |
63 | jshint.reporter('default'), | 63 | jshint.reporter('default'), |
64 | jshint.reporter('fail') | 64 | jshint.reporter('fail') |
65 | ] | 65 | ] |
66 | ); | 66 | ); |
67 | 67 | ||
68 | gulp.start('uglify'); | 68 | gulp.start('uglify'); |
69 | }); | 69 | }); |
70 | 70 | ||
71 | gulp.task('webserver', function() { | 71 | gulp.task('webserver', function() { |
72 | pump [ | 72 | pump [ |
73 | connect.server({port: 3000}) | 73 | connect.server({port: 3000}) |
74 | ] | 74 | ] |
75 | }); | 75 | }); |
76 | 76 | ||
77 | gulp.task('clean-post-install', function() { | 77 | gulp.task('clean-post-install', function() { |
78 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 78 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
79 | 'index.html'], {read: false}) | 79 | 'index.html'], {read: false}) |
80 | .pipe(clean()); | 80 | .pipe(clean()); |
81 | }); | 81 | }); |
82 | 82 | ||
83 | gulp.task('default', ['webserver']); | 83 | gulp.task('default', ['webserver']); |
84 | 84 |