Commit 320757ba04960d8333ebe5528d12fdfc62f17f4d
1 parent
c1bacd3f42
Exists in
master
Fix rutas 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 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'); | 5 | const uglify = require('gulp-uglify'); |
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('templates', function() { | 20 | gulp.task('templates', 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: 'focaModalFlete', | 26 | module: 'focaModalFlete', |
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-modal-flete.js'), | 41 | concat('foca-modal-flete.js'), |
42 | replace('src/views/', ''), | 42 | replace('src/views/', ''), |
43 | replace("['ui.bootstrap', 'focaDirectivas']", '[]'), | 43 | replace("['ui.bootstrap', 'focaDirectivas']", '[]'), |
44 | gulp.dest(paths.tmp), | 44 | gulp.dest(paths.tmp), |
45 | rename('foca-modal-flete.min.js'), | 45 | rename('foca-modal-flete.min.js'), |
46 | uglify(), | 46 | uglify(), |
47 | gulp.dest(paths.dist) | 47 | gulp.dest(paths.dist) |
48 | ] | 48 | ] |
49 | ); | 49 | ); |
50 | }); | 50 | }); |
51 | 51 | ||
52 | gulp.task('pre-commit', function() { | 52 | gulp.task('pre-commit', function() { |
53 | return pump( | 53 | return pump( |
54 | [ | 54 | [ |
55 | gulp.src(paths.srcJS), | 55 | gulp.src(paths.srcJS), |
56 | jshint('.jshintrc'), | 56 | jshint('.jshintrc'), |
57 | jshint.reporter('default'), | 57 | jshint.reporter('default'), |
58 | jshint.reporter('fail') | 58 | jshint.reporter('fail') |
59 | ] | 59 | ] |
60 | ); | 60 | ); |
61 | }); | 61 | }); |
62 | 62 | ||
63 | gulp.task('webserver', function() { | 63 | gulp.task('webserver', function() { |
64 | pump [ | 64 | pump [ |
65 | connect.server({port: 3000}) | 65 | connect.server({port: 3000}) |
66 | ] | 66 | ] |
67 | }); | 67 | }); |
68 | 68 | ||
69 | gulp.task('clean-post-install', function(){ | 69 | gulp.task('clean-post-install', function(){ |
70 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 70 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
71 | 'index.html'], {read: false}) | 71 | 'index.html'], {read: false}) |
72 | .pipe(clean()); | 72 | .pipe(clean()); |
73 | }); | 73 | }); |
74 | 74 | ||
75 | gulp.task('default', ['webserver']); | 75 | gulp.task('default', ['webserver']); |
76 | 76 | ||
77 | gulp.task('watch', function() { | 77 | gulp.task('watch', function() { |
78 | gulp.watch([srcJS, srcViews], ['uglify']); | 78 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); |
79 | }); | 79 | }); |
80 | 80 |