Commit fed0688a986192c371573c1d9cbf76abc304b99a
1 parent
239063bbfe
Exists in
master
and in
1 other branch
compilacion secuencial para evitar problemas con template
Showing
2 changed files
with
2 additions
and
3 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 | 11 | ||
| 12 | var paths = { | 12 | var paths = { | 
| 13 | srcJS: 'src/js/*.js', | 13 | srcJS: 'src/js/*.js', | 
| 14 | srcViews: 'src/views/*.html', | 14 | srcViews: 'src/views/*.html', | 
| 15 | tmp: 'tmp', | 15 | tmp: 'tmp', | 
| 16 | dist: 'dist/' | 16 | dist: 'dist/' | 
| 17 | }; | 17 | }; | 
| 18 | 18 | ||
| 19 | gulp.task('templates', function() { | 19 | gulp.task('templates', function() { | 
| 20 | pump( | 20 | pump( | 
| 21 | [ | 21 | [ | 
| 22 | gulp.src(paths.srcViews), | 22 | gulp.src(paths.srcViews), | 
| 23 | replace('views/', ''), | 23 | replace('views/', ''), | 
| 24 | htmlmin(), | 24 | htmlmin(), | 
| 25 | templateCache('views.js', { | 25 | templateCache('views.js', { | 
| 26 | module: 'focaBusquedaProductos', | 26 | module: 'focaBusquedaProductos', | 
| 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', function() { | 34 | gulp.task('uglify', function() { | 
| 35 | pump( | 35 | 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-busqueda-productos.js'), | 41 | concat('foca-busqueda-productos.js'), | 
| 42 | gulp.dest(paths.tmp), | 42 | gulp.dest(paths.tmp), | 
| 43 | rename('foca-busqueda-productos.min.js'), | 43 | rename('foca-busqueda-productos.min.js'), | 
| 44 | uglify(), | 44 | uglify(), | 
| 45 | gulp.dest(paths.dist) | 45 | gulp.dest(paths.dist) | 
| 46 | ] | 46 | ] | 
| 47 | ); | 47 | ); | 
| 48 | }); | 48 | }); | 
| 49 | 49 | ||
| 50 | gulp.task('pre-commit', function() { | 50 | gulp.task('pre-commit', function() { | 
| 51 | pump( | 51 | pump( | 
| 52 | [ | 52 | [ | 
| 53 | gulp.src(paths.srcJS), | 53 | gulp.src(paths.srcJS), | 
| 54 | jshint('.jshintrc'), | 54 | jshint('.jshintrc'), | 
| 55 | jshint.reporter('default'), | 55 | jshint.reporter('default'), | 
| 56 | jshint.reporter('fail') | 56 | jshint.reporter('fail') | 
| 57 | ] | 57 | ] | 
| 58 | ); | 58 | ); | 
| 59 | 59 | ||
| 60 | gulp.start('uglify'); | 60 | gulp.start('uglify'); | 
| 61 | gulp.start('templates'); | 61 | gulp.start('templates'); | 
| 62 | }); | 62 | }); | 
| 63 | 63 | ||
| 64 | gulp.task('compile', ['templates', 'uglify']); | ||
| 65 | |||
| 66 | gulp.task('webserver', function() { | 64 | gulp.task('webserver', function() { | 
| 67 | pump [ | 65 | pump [ | 
| 68 | connect.server({port: 3000}) | 66 | connect.server({port: 3000}) | 
| 69 | ] | 67 | ] | 
| 70 | }); | 68 | }); | 
| 71 | 69 | ||
| 72 | gulp.task('default', ['webserver']); | 70 | gulp.task('default', ['webserver']); | 
package.json
| 1 | { | 1 | { | 
| 2 | "name": "foca-modal-busqueda-productos", | 2 | "name": "foca-modal-busqueda-productos", | 
| 3 | "version": "0.0.1", | 3 | "version": "0.0.1", | 
| 4 | "description": "Menu de navegacion de doble entrada", | 4 | "description": "Menu de navegacion de doble entrada", | 
| 5 | "main": "index.js", | 5 | "main": "index.js", | 
| 6 | "scripts": { | 6 | "scripts": { | 
| 7 | "test": "echo \"Error: no test specified\" && exit 1", | 7 | "test": "echo \"Error: no test specified\" && exit 1", | 
| 8 | "gulp-pre-commit": "gulp pre-commit", | 8 | "gulp-pre-commit": "gulp pre-commit", | 
| 9 | "postinstall": "gulp compile && rm -R src && rm index.html && rm .jshintrc && rm gulpfile.js", | 9 | "compile": "gulp templates && gulp uglify", | 
| 10 | "postinstall": "npm run compile && rm -R src && rm index.html && rm .jshintrc && rm gulpfile.js", | ||
| 10 | "install-dev": "npm install -D angular bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify jasmine-core jquery jshint pre-commit pump ui-bootstrap4 && npm i -D git+https://192.168.0.11/modulos-npm/foca-directivas" | 11 | "install-dev": "npm install -D angular bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify jasmine-core jquery jshint pre-commit pump ui-bootstrap4 && npm i -D git+https://192.168.0.11/modulos-npm/foca-directivas" | 
| 11 | }, | 12 | }, | 
| 12 | "pre-commit": [ | 13 | "pre-commit": [ | 
| 13 | "gulp-pre-commit" | 14 | "gulp-pre-commit" | 
| 14 | ], | 15 | ], | 
| 15 | "repository": { | 16 | "repository": { | 
| 16 | "type": "git", | 17 | "type": "git", | 
| 17 | "url": "https://192.168.0.11/modulos-npm/foca-navegacion-doble" | 18 | "url": "https://192.168.0.11/modulos-npm/foca-navegacion-doble" | 
| 18 | }, | 19 | }, | 
| 19 | "author": "Nicolás Guarnieri", | 20 | "author": "Nicolás Guarnieri", | 
| 20 | "license": "ISC", | 21 | "license": "ISC", | 
| 21 | "peerDependencies": { | 22 | "peerDependencies": { | 
| 22 | "angular": "^1.7.4", | 23 | "angular": "^1.7.4", | 
| 23 | "bootstrap": "^4.1.3", | 24 | "bootstrap": "^4.1.3", | 
| 24 | "font-awesome": "^4.7.0", | 25 | "font-awesome": "^4.7.0", | 
| 25 | "ui-bootstrap4": "^3.0.4", | 26 | "ui-bootstrap4": "^3.0.4", | 
| 26 | "gulp": "^3.9.1", | 27 | "gulp": "^3.9.1", | 
| 27 | "gulp-angular-templatecache": "^2.2.1", | 28 | "gulp-angular-templatecache": "^2.2.1", | 
| 28 | "gulp-concat": "^2.6.1", | 29 | "gulp-concat": "^2.6.1", | 
| 29 | "gulp-connect": "^5.6.1", | 30 | "gulp-connect": "^5.6.1", | 
| 30 | "gulp-htmlmin": "^5.0.1", | 31 | "gulp-htmlmin": "^5.0.1", | 
| 31 | "gulp-rename": "^1.4.0", | 32 | "gulp-rename": "^1.4.0", | 
| 32 | "gulp-replace": "^1.0.0", | 33 | "gulp-replace": "^1.0.0", | 
| 33 | "gulp-uglify": "^3.0.1", | 34 | "gulp-uglify": "^3.0.1", | 
| 34 | "jquery": "^3.3.1", | 35 | "jquery": "^3.3.1", | 
| 35 | "pump": "^3.0.0", | 36 | "pump": "^3.0.0", | 
| 36 | "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas" | 37 | "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas" | 
| 37 | }, | 38 | }, | 
| 38 | "devDependencies": { | 39 | "devDependencies": { | 
| 39 | "angular": "^1.7.4", | 40 | "angular": "^1.7.4", | 
| 40 | "bootstrap": "^4.1.3", | 41 | "bootstrap": "^4.1.3", | 
| 41 | "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas", | 42 | "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas", | 
| 42 | "font-awesome": "^4.7.0", | 43 | "font-awesome": "^4.7.0", | 
| 43 | "gulp": "^3.9.1", | 44 | "gulp": "^3.9.1", | 
| 44 | "gulp-angular-templatecache": "^2.2.1", | 45 | "gulp-angular-templatecache": "^2.2.1", | 
| 45 | "gulp-concat": "^2.6.1", | 46 | "gulp-concat": "^2.6.1", | 
| 46 | "gulp-connect": "^5.6.1", | 47 | "gulp-connect": "^5.6.1", | 
| 47 | "gulp-htmlmin": "^5.0.1", | 48 | "gulp-htmlmin": "^5.0.1", | 
| 48 | "gulp-jshint": "^2.1.0", | 49 | "gulp-jshint": "^2.1.0", | 
| 49 | "gulp-rename": "^1.4.0", | 50 | "gulp-rename": "^1.4.0", | 
| 50 | "gulp-replace": "^1.0.0", | 51 | "gulp-replace": "^1.0.0", | 
| 51 | "gulp-uglify": "^3.0.1", | 52 | "gulp-uglify": "^3.0.1", | 
| 52 | "jasmine-core": "^3.2.1", | 53 | "jasmine-core": "^3.2.1", | 
| 53 | "jquery": "^3.3.1", | 54 | "jquery": "^3.3.1", | 
| 54 | "jshint": "^2.9.6", | 55 | "jshint": "^2.9.6", | 
| 55 | "pre-commit": "^1.2.2", | 56 | "pre-commit": "^1.2.2", | 
| 56 | "pump": "^3.0.0", | 57 | "pump": "^3.0.0", | 
| 57 | "ui-bootstrap4": "^3.0.4" | 58 | "ui-bootstrap4": "^3.0.4" | 
| 58 | } | 59 | } | 
| 59 | } | 60 | } | 
| 60 | 61 |