Commit 8db1394bc815075e87f97c55718c50de37f292ae
1 parent
7baa01a7d9
Exists in
master
fuera index, ok replace gulp
Showing
2 changed files
with
1 additions
and
32 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-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('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 | replace('views/', ''), | 24 | replace('views/', ''), |
25 | htmlmin(), | 25 | htmlmin(), |
26 | templateCache('views.js', { | 26 | templateCache('views.js', { |
27 | module: 'focaAbmVendedorCobrador', | 27 | module: 'focaAbmVendedorCobrador', |
28 | root: '' | 28 | root: '' |
29 | }), | 29 | }), |
30 | gulp.dest(paths.tmp) | 30 | gulp.dest(paths.tmp) |
31 | ] | 31 | ] |
32 | ); | 32 | ); |
33 | }); | 33 | }); |
34 | 34 | ||
35 | gulp.task('uglify', ['templates'], function() { | 35 | gulp.task('uglify', ['templates'], function() { |
36 | return pump( | 36 | return pump( |
37 | [ | 37 | [ |
38 | gulp.src([ | 38 | gulp.src([ |
39 | paths.srcJS, | 39 | paths.srcJS, |
40 | 'tmp/views.js' | 40 | 'tmp/views.js' |
41 | ]), | 41 | ]), |
42 | concat('foca-abm-vendedor-cobrador.js'), | 42 | concat('foca-abm-vendedor-cobrador.js'), |
43 | replace("['ngRoute', 'focaModal', 'ui.bootstrap']", '[]'), | 43 | replace("['ngRoute', 'focaModal', 'ui.bootstrap', 'focaBotoneraLateral']", '[]'), |
44 | replace("src/views/", ''), | 44 | replace("src/views/", ''), |
45 | gulp.dest(paths.tmp), | 45 | gulp.dest(paths.tmp), |
46 | rename('foca-abm-vendedor-cobrador.min.js'), | 46 | rename('foca-abm-vendedor-cobrador.min.js'), |
47 | uglify(), | 47 | uglify(), |
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 | pump( | 59 | 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('clean-post-install', function() { | 71 | gulp.task('clean-post-install', function() { |
72 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 72 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
73 | 'index.html'], {read: false}) | 73 | 'index.html'], {read: false}) |
74 | .pipe(clean()); | 74 | .pipe(clean()); |
75 | }); | 75 | }); |
76 | 76 | ||
77 | gulp.task('compile', ['templates', 'uglify']); | 77 | gulp.task('compile', ['templates', 'uglify']); |
78 | 78 | ||
79 | gulp.task('watch', function() { | 79 | gulp.task('watch', function() { |
80 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); | 80 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); |
81 | }); | 81 | }); |
82 | 82 | ||
83 | gulp.task('webserver', function() { | 83 | gulp.task('webserver', function() { |
84 | pump [ | 84 | pump [ |
85 | connect.server({port: 3000}) | 85 | connect.server({port: 3000}) |
86 | ] | 86 | ] |
87 | }); | 87 | }); |
88 | 88 | ||
89 | gulp.task('default', ['webserver']); | 89 | gulp.task('default', ['webserver']); |
90 | 90 |
index.html
1 | <html ng-app="focaAbmVehiculo"> | File was deleted | |
2 | <head> | ||
3 | <meta charset="UTF-8"/> | ||
4 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
5 | |||
6 | <!--CSS--> | ||
7 | <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/> | ||
8 | <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet"/> | ||
9 | |||
10 | <!--VENDOR JS--> | ||
11 | <script src="node_modules/jquery/dist/jquery.min.js"></script> | ||
12 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> | ||
13 | <script src="node_modules/angular/angular.min.js"></script> | ||
14 | <script src="node_modules/angular-route/angular-route.min.js"></script> | ||
15 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> | ||
16 | <script src="node_modules/foca-modal/dist/foca-modal.min.js"></script> | ||
17 | |||
18 | <!-- BUILD --> | ||
19 | <script src="src/js/app.js"></script> | ||
20 | <script src="src/js/route.js"></script> | ||
21 | <script src="src/js/controller.js"></script> | ||
22 | <script src="src/js/service.js"></script> | ||
23 | <!-- /BUILD --> | ||
24 | |||
25 | <!-- CONFIG PARA DEVELOP --> | ||
26 | <script src="src/etc/develop.js"></script> | ||
27 | </head> | ||
28 | <body style="background: #afafaf;padding: 25px"> | ||
29 | <div class="container-fluid pt-3 pb-3" ng-view style="background: #fff"></div> | ||
30 | </body> | ||
31 | </html> | ||
32 | 1 | <html ng-app="focaAbmVehiculo"> |