Commit 5226dd7e7f030b1767bd1d4f38ffd7a7631f431a
1 parent
50b6958db1
Exists in
master
- Agregué require para gulp-connect.
- Eliminé un gulp-replace que estaba duplicado en install-dev. - Eliminé el archivo de configuración develop.js - Agregué el archivo de configuración de ejemplo develop.ejemplo.js
Showing
4 changed files
with
6 additions
and
6 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 | 12 | ||
12 | var paths = { | 13 | var paths = { |
13 | srcJS: 'src/js/*.js', | 14 | srcJS: 'src/js/*.js', |
14 | srcViews: 'src/views/*.html', | 15 | srcViews: 'src/views/*.html', |
15 | tmp: 'tmp', | 16 | tmp: 'tmp', |
16 | dist: 'dist/' | 17 | dist: 'dist/' |
17 | }; | 18 | }; |
18 | 19 | ||
19 | gulp.task('templates', function() { | 20 | gulp.task('templates', function() { |
20 | return pump( | 21 | return pump( |
21 | [ | 22 | [ |
22 | gulp.src(paths.srcViews), | 23 | gulp.src(paths.srcViews), |
23 | htmlmin(), | 24 | htmlmin(), |
24 | templateCache('views.js', { | 25 | templateCache('views.js', { |
25 | module: 'focaAbmPreciosCondiciones', | 26 | module: 'focaAbmPreciosCondiciones', |
26 | root: '' | 27 | root: '' |
27 | }), | 28 | }), |
28 | gulp.dest(paths.tmp) | 29 | gulp.dest(paths.tmp) |
29 | ] | 30 | ] |
30 | ); | 31 | ); |
31 | }); | 32 | }); |
32 | 33 | ||
33 | gulp.task('uglify', ['templates'], function() { | 34 | gulp.task('uglify', ['templates'], function() { |
34 | return pump( | 35 | return pump( |
35 | [ | 36 | [ |
36 | gulp.src([ | 37 | gulp.src([ |
37 | paths.srcJS, | 38 | paths.srcJS, |
38 | 'tmp/views.js' | 39 | 'tmp/views.js' |
39 | ]), | 40 | ]), |
40 | concat('foca-abm-precios-condiciones.js'), | 41 | concat('foca-abm-precios-condiciones.js'), |
41 | replace('src/views/', ''), | 42 | replace('src/views/', ''), |
42 | replace("['ngRoute', 'ui.bootstrap']", '[]'), | 43 | replace("['ngRoute', 'ui.bootstrap']", '[]'), |
43 | gulp.dest(paths.tmp), | 44 | gulp.dest(paths.tmp), |
44 | rename('foca-abm-precios-condiciones.min.js'), | 45 | rename('foca-abm-precios-condiciones.min.js'), |
45 | uglify(), | 46 | uglify(), |
46 | gulp.dest(paths.dist) | 47 | gulp.dest(paths.dist) |
47 | ] | 48 | ] |
48 | ); | 49 | ); |
49 | }); | 50 | }); |
50 | 51 | ||
51 | gulp.task('clean', function() { | 52 | gulp.task('clean', function() { |
52 | return gulp.src(['tmp', 'dist'], {read: false}) | 53 | return gulp.src(['tmp', 'dist'], {read: false}) |
53 | .pipe(clean()); | 54 | .pipe(clean()); |
54 | }); | 55 | }); |
55 | 56 | ||
56 | gulp.task('pre-commit', function() { | 57 | gulp.task('pre-commit', function() { |
57 | pump( | 58 | pump( |
58 | [ | 59 | [ |
59 | gulp.src(paths.srcJS), | 60 | gulp.src(paths.srcJS), |
60 | jshint('.jshintrc'), | 61 | jshint('.jshintrc'), |
61 | jshint.reporter('default'), | 62 | jshint.reporter('default'), |
62 | jshint.reporter('fail') | 63 | jshint.reporter('fail') |
63 | ] | 64 | ] |
64 | ); | 65 | ); |
65 | }); | 66 | }); |
66 | 67 | ||
67 | gulp.task('clean-post-install', function() { | 68 | gulp.task('clean-post-install', function() { |
68 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 69 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
69 | 'index.html'], {read: false}) | 70 | 'index.html'], {read: false}) |
70 | .pipe(clean()); | 71 | .pipe(clean()); |
71 | }); | 72 | }); |
72 | 73 | ||
73 | gulp.task('webserver', function() { | 74 | gulp.task('webserver', function() { |
74 | pump [ | 75 | pump [ |
75 | connect.server({port: 3000}) | 76 | connect.server({port: 3000}) |
76 | ] | 77 | ] |
77 | }); | 78 | }); |
78 | 79 | ||
79 | gulp.task('default', ['webserver']); | 80 | gulp.task('default', ['webserver']); |
80 | 81 |
package.json
1 | { | 1 | { |
2 | "name": "foca-abm-precios-condiciones", | 2 | "name": "foca-abm-precios-condiciones", |
3 | "version": "1.0.0", | 3 | "version": "1.0.0", |
4 | "description": "ABM de precios y condiciones", | 4 | "description": "ABM de precios y condiciones", |
5 | "main": "dist/foca-abm-precios-condiciones.js", | 5 | "main": "dist/foca-abm-precios-condiciones.js", |
6 | "scripts": { | 6 | "scripts": { |
7 | "test": "echo \"Error: no test specified\" && exit 1", | 7 | "test": "echo \"Error: no test specified\" && exit 1", |
8 | "compile": "gulp uglify", | 8 | "compile": "gulp uglify", |
9 | "gulp-pre-commit": "gulp pre-commit", | 9 | "gulp-pre-commit": "gulp pre-commit", |
10 | "postinstall": "npm run compile && gulp clean-post-install", | 10 | "postinstall": "npm run compile && gulp clean-post-install", |
11 | "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-replace jquery jshint pump" | 11 | "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es jquery jshint pump" |
12 | }, | 12 | }, |
13 | "pre-commit": [ | 13 | "pre-commit": [ |
14 | "gulp-pre-commit" | 14 | "gulp-pre-commit" |
15 | ], | 15 | ], |
16 | "repository": { | 16 | "repository": { |
17 | "type": "git", | 17 | "type": "git", |
18 | "url": "https://192.168.0.11/modulos-npm/foca-abm-precios-condiciones.git" | 18 | "url": "https://192.168.0.11/modulos-npm/foca-abm-precios-condiciones.git" |
19 | }, | 19 | }, |
20 | "author": "Foca Software", | 20 | "author": "Foca Software", |
21 | "license": "ISC", | 21 | "license": "ISC", |
22 | "peerDependencies": { | 22 | "peerDependencies": { |
23 | "angular": "^1.7.x", | 23 | "angular": "^1.7.x", |
24 | "bootstrap": "^4.1.x", | 24 | "bootstrap": "^4.1.x", |
25 | "jquery": "^3.3.x", | 25 | "jquery": "^3.3.x", |
26 | "font-awesome": "^4.7.x", | 26 | "font-awesome": "^4.7.x", |
27 | "gulp": "^3.9.x", | 27 | "gulp": "^3.9.x", |
28 | "gulp-concat": "2.6.x", | 28 | "gulp-concat": "2.6.x", |
29 | "gulp-jshint": "^2.1.x", | 29 | "gulp-jshint": "^2.1.x", |
30 | "gulp-rename": "^1.4.x", | 30 | "gulp-rename": "^1.4.x", |
31 | "gulp-replace": "^1.0.x", | 31 | "gulp-replace": "^1.0.x", |
32 | "gulp-uglify-es": "^1.0.x", | 32 | "gulp-uglify-es": "^1.0.x", |
33 | "jshint": "^2.9.x", | 33 | "jshint": "^2.9.x", |
34 | "pump": "^3.0.x" | 34 | "pump": "^3.0.x" |
35 | }, | 35 | }, |
36 | "devDependencies": { | 36 | "devDependencies": { |
37 | "angular": "^1.7.4", | 37 | "angular": "^1.7.4", |
38 | "angular-route": "^1.7.5", | 38 | "angular-route": "^1.7.5", |
39 | "bootstrap": "^4.1.3", | 39 | "bootstrap": "^4.1.3", |
40 | "font-awesome": "^4.7.0", | 40 | "font-awesome": "^4.7.0", |
41 | "gulp": "^3.9.1", | 41 | "gulp": "^3.9.1", |
42 | "gulp-angular-templatecache": "^2.2.1", | 42 | "gulp-angular-templatecache": "^2.2.1", |
43 | "gulp-clean": "^0.4.0", | 43 | "gulp-clean": "^0.4.0", |
44 | "gulp-connect": "^5.6.1", | 44 | "gulp-connect": "^5.6.1", |
45 | "gulp-htmlmin": "^5.0.1", | 45 | "gulp-htmlmin": "^5.0.1", |
46 | "gulp-jshint": "^2.1.0", | 46 | "gulp-jshint": "^2.1.0", |
47 | "gulp-rename": "^1.4.0", | 47 | "gulp-rename": "^1.4.0", |
48 | "gulp-replace": "^1.0.0", | 48 | "gulp-replace": "^1.0.0", |
49 | "gulp-sequence": "^1.0.0", | 49 | "gulp-sequence": "^1.0.0", |
50 | "gulp-uglify-es": "^1.0.4", | 50 | "gulp-uglify-es": "^1.0.4", |
51 | "jasmine-core": "^3.2.1", | 51 | "jasmine-core": "^3.2.1", |
52 | "jquery": "^3.3.1", | 52 | "jquery": "^3.3.1", |
53 | "jshint": "^2.9.6", | 53 | "jshint": "^2.9.6", |
54 | "pre-commit": "^1.2.2", | 54 | "pre-commit": "^1.2.2", |
55 | "pump": "^3.0.0", | 55 | "pump": "^3.0.0", |
56 | "ui-bootstrap4": "^3.0.5" | 56 | "ui-bootstrap4": "^3.0.5" |
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 |
src/etc/develop.ejemplo.js
File was created | 1 | angular.module('focaAbmSectores') | |
2 | .constant("API_ENDPOINT", { | ||
3 | 'URL': '//127.0.0.1:9000' | ||
4 | }); | ||
5 |
src/etc/develop.js
1 | angular.module('focaAbmPreciosCondiciones') | File was deleted | |
2 | .constant("API_ENDPOINT", { | ||
3 | 'URL': 'http://192.168.0.23:9900' | ||
4 | }); | ||
5 |