forked from phpmycoder/cryptico-node
-
Notifications
You must be signed in to change notification settings - Fork 26
/
gulpfile.js
59 lines (50 loc) · 1.76 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
'use strict';
var pkg = require('./package.json')
,gulp = require('gulp')
,concat = require('gulp-concat')
,header = require('gulp-header')
,uglify = require('gulp-uglify')
,rename = require('gulp-rename')
,browserify = require('gulp-browserify')
;
gulp.task('lib',function(){
gulp
.src([
'src/jsbn.js'
,'src/random.js'
,'src/hash.js'
,'src/rsa.js'
,'src/aes.js'
,'src/api.js'
,'src/exports.js'
])
.pipe(concat('cryptico.js'))
.pipe(header('/* cryptico-js v${pkg.version} - ${file.name} - https://github.com/tracker1/cryptico-js */\n\n', {pkg:pkg}))
.pipe(gulp.dest('lib/'))
;
});
gulp.task('browser',['lib'],function(){
return gulp
.src('lib/cryptico.js')
.pipe(browserify({standalone:'cryptico'}))
.pipe(header('/* cryptico-js v${pkg.version} - ${file.name} - https://github.com/tracker1/cryptico-js */\n\n', {pkg:pkg}))
.pipe(rename('cryptico.browser.js'))
.pipe(gulp.dest('dist/'))
.pipe(uglify())
.pipe(rename('cryptico.browser.min.js'))
.pipe(header('/* cryptico-js v${pkg.version} - ${file.name} - https://github.com/tracker1/cryptico-js */\n\n', {pkg:pkg}))
.pipe(gulp.dest('dist/'))
});
gulp.task('amd',['lib'],function(){
return gulp
.src('lib/cryptico.js')
.pipe(browserify())
.pipe(header('/* cryptico-js v${pkg.version} - ${file.name} - https://github.com/tracker1/cryptico-js */\n\n', {pkg:pkg}))
.pipe(rename('cryptico.amd.js'))
.pipe(gulp.dest('dist/'))
.pipe(uglify())
.pipe(rename('cryptico.amd.min.js'))
.pipe(header('/* cryptico-js v${pkg.version} - ${file.name} - https://github.com/tracker1/cryptico-js */\n\n', {pkg:pkg}))
.pipe(gulp.dest('dist/'))
});
gulp.task('default',['lib','browser','amd']);