Commit 72bb9649215fa05b743240b5e8a6bf6ec4a9920b
1 parent
77ce4d0b16
Exists in
master
saco archivo test.html en post install
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 clean = require('gulp-clean'); | 3 | const clean = require('gulp-clean'); |
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-es').default; | 6 | const uglify = require('gulp-uglify-es').default; |
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 | const header = require('gulp-header'); | 12 | const header = require('gulp-header'); |
13 | const footer = require('gulp-footer'); | 13 | const footer = require('gulp-footer'); |
14 | 14 | ||
15 | var paths = { | 15 | var paths = { |
16 | srcJS: 'src/js/*.js', | 16 | srcJS: 'src/js/*.js', |
17 | srcViews: 'src/views/*.html', | 17 | srcViews: 'src/views/*.html', |
18 | specs: 'spec/*.js', | 18 | specs: 'spec/*.js', |
19 | tmp: 'tmp', | 19 | tmp: 'tmp', |
20 | dist: 'dist/' | 20 | dist: 'dist/' |
21 | }; | 21 | }; |
22 | 22 | ||
23 | gulp.task('templates', function() { | 23 | gulp.task('templates', function() { |
24 | return pump( | 24 | return pump( |
25 | [ | 25 | [ |
26 | gulp.src(paths.srcViews), | 26 | gulp.src(paths.srcViews), |
27 | htmlmin(), | 27 | htmlmin(), |
28 | templateCache('views.js', { | 28 | templateCache('views.js', { |
29 | module: 'focaAbmPreciosCondiciones', | 29 | module: 'focaAbmPreciosCondiciones', |
30 | root: '' | 30 | root: '' |
31 | }), | 31 | }), |
32 | gulp.dest(paths.tmp) | 32 | gulp.dest(paths.tmp) |
33 | ] | 33 | ] |
34 | ); | 34 | ); |
35 | }); | 35 | }); |
36 | 36 | ||
37 | gulp.task('uglify', ['templates', 'uglify-spec'], function() { | 37 | gulp.task('uglify', ['templates', 'uglify-spec'], function() { |
38 | return pump( | 38 | return pump( |
39 | [ | 39 | [ |
40 | gulp.src([ | 40 | gulp.src([ |
41 | paths.srcJS, | 41 | paths.srcJS, |
42 | 'tmp/views.js' | 42 | 'tmp/views.js' |
43 | ]), | 43 | ]), |
44 | concat('foca-abm-precios-condiciones.js'), | 44 | concat('foca-abm-precios-condiciones.js'), |
45 | replace('src/views/', ''), | 45 | replace('src/views/', ''), |
46 | gulp.dest(paths.tmp), | 46 | gulp.dest(paths.tmp), |
47 | rename('foca-abm-precios-condiciones.min.js'), | 47 | rename('foca-abm-precios-condiciones.min.js'), |
48 | uglify(), | 48 | uglify(), |
49 | gulp.dest(paths.dist) | 49 | gulp.dest(paths.dist) |
50 | ] | 50 | ] |
51 | ); | 51 | ); |
52 | }); | 52 | }); |
53 | 53 | ||
54 | gulp.task('uglify-spec', function() { | 54 | gulp.task('uglify-spec', function() { |
55 | return pump([ | 55 | return pump([ |
56 | gulp.src(paths.specs), | 56 | gulp.src(paths.specs), |
57 | concat('foca-abm-precios-condiciones.spec.js'), | 57 | concat('foca-abm-precios-condiciones.spec.js'), |
58 | replace("src/views/", ''), | 58 | replace("src/views/", ''), |
59 | header("describe('Módulo foca-abm-precios-condiciones', function() { \n"), | 59 | header("describe('Módulo foca-abm-precios-condiciones', function() { \n"), |
60 | footer("});"), | 60 | footer("});"), |
61 | gulp.dest(paths.dist) | 61 | gulp.dest(paths.dist) |
62 | ]); | 62 | ]); |
63 | }); | 63 | }); |
64 | 64 | ||
65 | gulp.task('clean', function() { | 65 | gulp.task('clean', function() { |
66 | return gulp.src(['tmp', 'dist'], {read: false}) | 66 | return gulp.src(['tmp', 'dist'], {read: false}) |
67 | .pipe(clean()); | 67 | .pipe(clean()); |
68 | }); | 68 | }); |
69 | 69 | ||
70 | gulp.task('pre-commit', function() { | 70 | gulp.task('pre-commit', function() { |
71 | return pump( | 71 | return pump( |
72 | [ | 72 | [ |
73 | gulp.src([paths.srcJS, paths.specs]), | 73 | gulp.src([paths.srcJS, paths.specs]), |
74 | jshint('.jshintrc'), | 74 | jshint('.jshintrc'), |
75 | jshint.reporter('default'), | 75 | jshint.reporter('default'), |
76 | jshint.reporter('fail') | 76 | jshint.reporter('fail') |
77 | ] | 77 | ] |
78 | ); | 78 | ); |
79 | }); | 79 | }); |
80 | 80 | ||
81 | gulp.task('clean-post-install', function() { | 81 | gulp.task('clean-post-install', function() { |
82 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 82 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
83 | 'index.html', 'spec'], {read: false}) | 83 | 'index.html', 'spec', 'test.html'], {read: false}) |
84 | .pipe(clean()); | 84 | .pipe(clean()); |
85 | }); | 85 | }); |
86 | 86 | ||
87 | gulp.task('webserver', function() { | 87 | gulp.task('webserver', function() { |
88 | pump [ | 88 | pump [ |
89 | connect.server({port: 3000}) | 89 | connect.server({port: 3000}) |
90 | ] | 90 | ] |
91 | }); | 91 | }); |
92 | 92 | ||
93 | gulp.task('default', ['webserver']); | 93 | gulp.task('default', ['webserver']); |
94 | 94 |