Commit abf1d07fc335f5cadc5bcc1248fce89115d404dd

Authored by Nicolás Guarnieri
1 parent fed0688a98
Exists in master and in 1 other branch develop

gulp compile definitivo

Showing 3 changed files with 6 additions and 7 deletions   Show diff stats
1 { 1 {
2 /* 2 /*
3 * ENVIRONMENTS 3 * ENVIRONMENTS
4 * ================= 4 * =================
5 */ 5 */
6 6
7 // Define globals exposed by modern browsers. 7 // Define globals exposed by modern browsers.
8 "browser": true, 8 "browser": true,
9 9
10 // Define globals exposed by jQuery. 10 // Define globals exposed by jQuery.
11 "jquery": true, 11 "jquery": true,
12 12
13 // Define globals exposed by Node.js. 13 // Define globals exposed by Node.js.
14 "node": true, 14 "node": true,
15 15
16 // Allow ES6. 16 // Allow ES6.
17 "esversion": 6, 17 "esversion": 6,
18 18
19 /* 19 /*
20 * ENFORCING OPTIONS 20 * ENFORCING OPTIONS
21 * ================= 21 * =================
22 */ 22 */
23 23
24 // Force all variable names to use either camelCase style or UPPER_CASE 24 // Force all variable names to use either camelCase style or UPPER_CASE
25 // with underscores. 25 // with underscores.
26 "camelcase": true, 26 "camelcase": true,
27 27
28 // Prohibit use of == and != in favor of === and !==. 28 // Prohibit use of == and != in favor of === and !==.
29 "eqeqeq": true, 29 "eqeqeq": true,
30 30
31 // Enforce tab width of 2 spaces. 31 // Enforce tab width of 2 spaces.
32 "indent": 4, 32 "indent": 4,
33 33
34 // Prohibit use of a variable before it is defined. 34 // Prohibit use of a variable before it is defined.
35 "latedef": true, 35 "latedef": false,
36 36
37 // Enforce line length to 100 characters 37 // Enforce line length to 100 characters
38 "maxlen": 100, 38 "maxlen": 100,
39 39
40 // Require capitalized names for constructor functions. 40 // Require capitalized names for constructor functions.
41 "newcap": true, 41 "newcap": true,
42 42
43 // Enforce use of single quotation marks for strings. 43 // Enforce use of single quotation marks for strings.
44 "quotmark": "single", 44 "quotmark": "single",
45 45
46 // Enforce placing 'use strict' at the top function scope 46 // Enforce placing 'use strict' at the top function scope
47 "strict": false, 47 "strict": false,
48 48
49 // Prohibit use of explicitly undeclared variables. 49 // Prohibit use of explicitly undeclared variables.
50 "undef": true, 50 "undef": true,
51 51
52 // Warn when variables are defined but never used. 52 // Warn when variables are defined but never used.
53 "unused": true, 53 "unused": true,
54 54
55 // Para que funcione en angular 55 // Para que funcione en angular
56 "predef": ["angular", "alert", "spyOn", "expect", "it", "inject", "beforeEach", "describe"], 56 "predef": ["angular", "alert", "spyOn", "expect", "it", "inject", "beforeEach", "describe"],
57 /* 57 /*
58 * RELAXING OPTIONS 58 * RELAXING OPTIONS
59 * ================= 59 * =================
60 */ 60 */
61 61
62 // Suppress warnings about == null comparisons. 62 // Suppress warnings about == null comparisons.
63 "eqnull": true 63 "eqnull": true
64 } 64 }
65 65
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 return 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', ['templates'], function() {
35 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-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 return 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');
62 }); 61 });
63 62
64 gulp.task('webserver', function() { 63 gulp.task('webserver', function() {
65 pump [ 64 pump [
66 connect.server({port: 3000}) 65 connect.server({port: 3000})
67 ] 66 ]
68 }); 67 });
69 68
70 gulp.task('default', ['webserver']); 69 gulp.task('default', ['webserver']);
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 "compile": "gulp templates && gulp uglify", 9 "compile": "gulp uglify",
10 "postinstall": "npm run compile && rm -R src && rm index.html && rm .jshintrc && rm gulpfile.js", 10 "postinstall": "npm run compile && rm -R src && rm index.html && rm .jshintrc && rm gulpfile.js",
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 "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"
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-navegacion-doble" 18 "url": "https://192.168.0.11/modulos-npm/foca-navegacion-doble"
19 }, 19 },
20 "author": "Nicolás Guarnieri", 20 "author": "Nicolás Guarnieri",
21 "license": "ISC", 21 "license": "ISC",
22 "peerDependencies": { 22 "peerDependencies": {
23 "angular": "^1.7.4", 23 "angular": "^1.7.4",
24 "bootstrap": "^4.1.3", 24 "bootstrap": "^4.1.3",
25 "font-awesome": "^4.7.0", 25 "font-awesome": "^4.7.0",
26 "ui-bootstrap4": "^3.0.4", 26 "ui-bootstrap4": "^3.0.4",
27 "gulp": "^3.9.1", 27 "gulp": "^3.9.1",
28 "gulp-angular-templatecache": "^2.2.1", 28 "gulp-angular-templatecache": "^2.2.1",
29 "gulp-concat": "^2.6.1", 29 "gulp-concat": "^2.6.1",
30 "gulp-connect": "^5.6.1", 30 "gulp-connect": "^5.6.1",
31 "gulp-htmlmin": "^5.0.1", 31 "gulp-htmlmin": "^5.0.1",
32 "gulp-rename": "^1.4.0", 32 "gulp-rename": "^1.4.0",
33 "gulp-replace": "^1.0.0", 33 "gulp-replace": "^1.0.0",
34 "gulp-uglify": "^3.0.1", 34 "gulp-uglify": "^3.0.1",
35 "jquery": "^3.3.1", 35 "jquery": "^3.3.1",
36 "pump": "^3.0.0", 36 "pump": "^3.0.0",
37 "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"
38 }, 38 },
39 "devDependencies": { 39 "devDependencies": {
40 "angular": "^1.7.4", 40 "angular": "^1.7.4",
41 "bootstrap": "^4.1.3", 41 "bootstrap": "^4.1.3",
42 "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",
43 "font-awesome": "^4.7.0", 43 "font-awesome": "^4.7.0",
44 "gulp": "^3.9.1", 44 "gulp": "^3.9.1",
45 "gulp-angular-templatecache": "^2.2.1", 45 "gulp-angular-templatecache": "^2.2.1",
46 "gulp-concat": "^2.6.1", 46 "gulp-concat": "^2.6.1",
47 "gulp-connect": "^5.6.1", 47 "gulp-connect": "^5.6.1",
48 "gulp-htmlmin": "^5.0.1", 48 "gulp-htmlmin": "^5.0.1",
49 "gulp-jshint": "^2.1.0", 49 "gulp-jshint": "^2.1.0",
50 "gulp-rename": "^1.4.0", 50 "gulp-rename": "^1.4.0",
51 "gulp-replace": "^1.0.0", 51 "gulp-replace": "^1.0.0",
52 "gulp-uglify": "^3.0.1", 52 "gulp-uglify": "^3.0.1",
53 "jasmine-core": "^3.2.1", 53 "jasmine-core": "^3.2.1",
54 "jquery": "^3.3.1", 54 "jquery": "^3.3.1",
55 "jshint": "^2.9.6", 55 "jshint": "^2.9.6",
56 "pre-commit": "^1.2.2", 56 "pre-commit": "^1.2.2",
57 "pump": "^3.0.0", 57 "pump": "^3.0.0",
58 "ui-bootstrap4": "^3.0.4" 58 "ui-bootstrap4": "^3.0.4"
59 } 59 }
60 } 60 }
61 61