Commit 51b757cb134eade00c1f181d85afbca5e567af60
1 parent
2c0fff212e
Exists in
master
and in
2 other branches
instalacion
Showing
2 changed files
with
6 additions
and
7 deletions
Show diff stats
gulpfile.js
1 | const clean = require('gulp-clean'); | 1 | const clean = require('gulp-clean'); |
2 | const concat = require('gulp-concat'); | 2 | const concat = require('gulp-concat'); |
3 | const connect = require('gulp-connect'); | 3 | const connect = require('gulp-connect'); |
4 | const gulp = require('gulp'); | 4 | const gulp = require('gulp'); |
5 | const htmlmin = require('gulp-htmlmin'); | 5 | const htmlmin = require('gulp-htmlmin'); |
6 | const jshint = require('gulp-jshint'); | 6 | const jshint = require('gulp-jshint'); |
7 | const pump = require('pump'); | 7 | const pump = require('pump'); |
8 | const rename = require('gulp-rename'); | 8 | const rename = require('gulp-rename'); |
9 | const replace = require('gulp-replace'); | 9 | const replace = require('gulp-replace'); |
10 | const templateCache = require('gulp-angular-templatecache'); | 10 | const templateCache = require('gulp-angular-templatecache'); |
11 | const uglify = require('gulp-uglify-es').default; | 11 | const uglify = require('gulp-uglify'); |
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', ['clean'], function() { | 20 | gulp.task('templates', ['clean'], 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: 'focaLogin', | 26 | module: 'focaLogin', |
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-login.js'), | 41 | concat('foca-login.js'), |
42 | replace("['ngRoute', 'ngCookies', 'focaDirectivas']",'[]'), | 42 | replace("['ngRoute', 'ngCookies', 'focaDirectivas']",'[]'), |
43 | replace('src/views/', ''), | 43 | replace('src/views/', ''), |
44 | gulp.dest(paths.tmp), | 44 | gulp.dest(paths.tmp), |
45 | rename('foca-login.min.js'), | 45 | rename('foca-login.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('compile', ['templates', 'uglify']); | 74 | gulp.task('compile', ['templates', 'uglify']); |
75 | 75 | ||
76 | gulp.task('webserver', function() { | 76 | gulp.task('webserver', function() { |
77 | pump [ | 77 | pump [ |
78 | connect.server({port: 3000}) | 78 | connect.server({port: 3000}) |
79 | ] | 79 | ] |
80 | }); | 80 | }); |
81 | 81 | ||
82 | gulp.task('default', ['webserver']); | 82 | gulp.task('default', ['webserver']); |
83 | 83 | ||
84 | gulp.task('watch', function() { | 84 | gulp.task('watch', function() { |
85 | return gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); | 85 | return gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); |
86 | }); | 86 | }); |
87 | 87 |
package.json
1 | { | 1 | { |
2 | "name": "foca-login", | 2 | "name": "foca-login", |
3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
4 | "description": "Login", | 4 | "description": "Login", |
5 | "main": "dist/foca-login.js", | 5 | "main": "dist/foca-login.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 compile", | ||
9 | "gulp-pre-commit": "gulp pre-commit", | 8 | "gulp-pre-commit": "gulp pre-commit", |
10 | "postinstall": "npm run compile && gulp clean-post-install", | 9 | "postinstall": "gulp uglify && gulp clean-post-install", |
11 | "install-dev": "npm install -D gulp gulp-connect jasmine-core pre-commit angular angular-route angular-cookies bootstrap font-awesome gulp-angular-templatecache gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-replace jquery jshint pump && npm i -D git+https://debo.suite.repo/modulos-npm/foca-directivas" | 10 | "install-dev": "npm install -D gulp gulp-connect jasmine-core pre-commit angular angular-route angular-cookies bootstrap font-awesome gulp-angular-templatecache gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify gulp-replace jquery jshint pump && npm i -D git+https://debo.suite.repo/modulos-npm/foca-directivas" |
12 | }, | 11 | }, |
13 | "pre-commit": [ | 12 | "pre-commit": [ |
14 | "gulp-pre-commit" | 13 | "gulp-pre-commit" |
15 | ], | 14 | ], |
16 | "repository": { | 15 | "repository": { |
17 | "type": "git", | 16 | "type": "git", |
18 | "url": "https://debo.suite.repo/modulos-npm/foca-login.git" | 17 | "url": "https://debo.suite.repo/modulos-npm/foca-login.git" |
19 | }, | 18 | }, |
20 | "author": "Foca Software", | 19 | "author": "Foca Software", |
21 | "license": "ISC", | 20 | "license": "ISC", |
22 | "peerDependencies": { | 21 | "peerDependencies": { |
23 | "angular": "^1.7.x", | 22 | "angular": "^1.7.x", |
24 | "bootstrap": "^4.1.x", | 23 | "bootstrap": "^4.1.x", |
25 | "jquery": "^3.3.x", | 24 | "jquery": "^3.3.x", |
26 | "font-awesome": "^4.7.x", | 25 | "font-awesome": "^4.7.x", |
27 | "gulp": "^3.9.x", | 26 | "gulp": "^3.9.x", |
28 | "gulp-concat": "2.6.x", | 27 | "gulp-concat": "2.6.x", |
29 | "gulp-jshint": "^2.1.x", | 28 | "gulp-jshint": "^2.1.x", |
30 | "gulp-rename": "^1.4.x", | 29 | "gulp-rename": "^1.4.x", |
31 | "gulp-replace": "^1.0.x", | 30 | "gulp-replace": "^1.0.x", |
32 | "gulp-uglify-es": "^1.0.x", | 31 | "gulp-uglify-es": "^1.0.x", |
33 | "jshint": "^2.9.x", | 32 | "jshint": "^2.9.x", |
34 | "pump": "^3.0.x", | 33 | "pump": "^3.0.x", |
35 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas" | 34 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas" |
36 | }, | 35 | }, |
37 | "devDependencies": { | 36 | "devDependencies": { |
38 | "angular": "^1.7.5", | 37 | "angular": "^1.7.5", |
39 | "angular-cookies": "^1.7.5", | 38 | "angular-cookies": "^1.7.5", |
40 | "angular-route": "^1.7.5", | 39 | "angular-route": "^1.7.5", |
41 | "bootstrap": "^4.1.3", | 40 | "bootstrap": "^4.1.3", |
42 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas", | 41 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas", |
43 | "font-awesome": "^4.7.0", | 42 | "font-awesome": "^4.7.0", |
44 | "gulp": "^3.9.1", | 43 | "gulp": "^3.9.1", |
45 | "gulp-angular-templatecache": "^2.2.2", | 44 | "gulp-angular-templatecache": "^2.2.3", |
46 | "gulp-clean": "^0.4.0", | 45 | "gulp-clean": "^0.4.0", |
47 | "gulp-connect": "^5.6.1", | 46 | "gulp-connect": "^5.6.1", |
48 | "gulp-htmlmin": "^5.0.1", | 47 | "gulp-htmlmin": "^5.0.1", |
49 | "gulp-jshint": "^2.1.0", | 48 | "gulp-jshint": "^2.1.0", |
50 | "gulp-rename": "^1.4.0", | 49 | "gulp-rename": "^1.4.0", |
51 | "gulp-replace": "^1.0.0", | 50 | "gulp-replace": "^1.0.0", |
52 | "gulp-sequence": "^1.0.0", | 51 | "gulp-sequence": "^1.0.0", |
53 | "gulp-uglify-es": "^1.0.4", | 52 | "gulp-uglify": "^3.0.1", |
54 | "jasmine-core": "^3.2.1", | 53 | "jasmine-core": "^3.3.0", |
55 | "jquery": "^3.3.1", | 54 | "jquery": "^3.3.1", |
56 | "jshint": "^2.9.6", | 55 | "jshint": "^2.9.6", |
57 | "pre-commit": "^1.2.2", | 56 | "pre-commit": "^1.2.2", |
58 | "pump": "^3.0.0" | 57 | "pump": "^3.0.0" |
59 | } | 58 | } |
60 | } | 59 | } |
61 | 60 |