Commit f9bff7acece72dcd71b8740055ecae0d3cd8003a
1 parent
5226dd7e7f
Exists in
master
- Removí espacios.
- Formateé html. - Modifiqué nombre de módulo en develop.ejemplo.js
Showing
3 changed files
with
26 additions
and
27 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 | 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: 'focaAbmPreciosCondiciones', | 26 | module: 'focaAbmPreciosCondiciones', |
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-abm-precios-condiciones.js'), | 41 | concat('foca-abm-precios-condiciones.js'), |
42 | replace('src/views/', ''), | 42 | replace('src/views/', ''), |
43 | replace("['ngRoute', 'ui.bootstrap']", '[]'), | 43 | replace("['ngRoute', 'ui.bootstrap']", '[]'), |
44 | gulp.dest(paths.tmp), | 44 | gulp.dest(paths.tmp), |
45 | rename('foca-abm-precios-condiciones.min.js'), | 45 | rename('foca-abm-precios-condiciones.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('clean', function() { | 52 | gulp.task('clean', function() { |
53 | return gulp.src(['tmp', 'dist'], {read: false}) | 53 | return gulp.src(['tmp', 'dist'], {read: false}) |
54 | .pipe(clean()); | 54 | .pipe(clean()); |
55 | }); | 55 | }); |
56 | 56 | ||
57 | gulp.task('pre-commit', function() { | 57 | gulp.task('pre-commit', function() { |
58 | pump( | 58 | pump( |
59 | [ | 59 | [ |
60 | gulp.src(paths.srcJS), | 60 | gulp.src(paths.srcJS), |
61 | jshint('.jshintrc'), | 61 | jshint('.jshintrc'), |
62 | jshint.reporter('default'), | 62 | jshint.reporter('default'), |
63 | jshint.reporter('fail') | 63 | jshint.reporter('fail') |
64 | ] | 64 | ] |
65 | ); | 65 | ); |
66 | }); | 66 | }); |
67 | 67 | ||
68 | gulp.task('clean-post-install', function() { | 68 | gulp.task('clean-post-install', function() { |
69 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 69 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
70 | 'index.html'], {read: false}) | 70 | 'index.html'], {read: false}) |
71 | .pipe(clean()); | 71 | .pipe(clean()); |
72 | }); | 72 | }); |
73 | 73 | ||
74 | gulp.task('webserver', function() { | 74 | gulp.task('webserver', function() { |
75 | pump [ | 75 | pump [ |
76 | connect.server({port: 3000}) | 76 | connect.server({port: 3000}) |
77 | ] | 77 | ] |
78 | }); | 78 | }); |
79 | 79 | ||
80 | gulp.task('default', ['webserver']); | 80 | gulp.task('default', ['webserver']); |
81 | 81 |
index.html
1 | <html ng-app="focaAbmPreciosCondiciones"> | 1 | <html ng-app="focaAbmPreciosCondiciones"> |
2 | <head> | ||
3 | <meta charset="UTF-8" /> | ||
4 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
2 | 5 | ||
3 | <head> | 6 | <!--CSS--> |
4 | <meta charset="UTF-8" /> | 7 | <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" /> |
5 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | 8 | <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet" /> |
6 | 9 | ||
7 | <!--CSS--> | 10 | <!--VENDOR JS--> |
8 | <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" /> | 11 | <script src="node_modules/jquery/dist/jquery.min.js"></script> |
9 | <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet" /> | 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> | ||
10 | 16 | ||
11 | <!--VENDOR JS--> | ||
12 | <script src="node_modules/jquery/dist/jquery.min.js"></script> | ||
13 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> | ||
14 | <script src="node_modules/angular/angular.min.js"></script> | ||
15 | <script src="node_modules/angular-route/angular-route.min.js"></script> | ||
16 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.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 | <script src="src/etc/develop.js"></script> |
src/etc/develop.ejemplo.js
1 | angular.module('focaAbmSectores') | 1 | angular.module('focaAbmPreciosCondiciones') |
2 | .constant("API_ENDPOINT", { | 2 | .constant("API_ENDPOINT", { |
3 | 'URL': '//127.0.0.1:9000' | 3 | 'URL': '//127.0.0.1:9000' |
4 | }); | 4 | }); |
5 | 5 |