forked from chriswongtv/node-all-paths
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGulpfile.js
32 lines (28 loc) · 774 Bytes
/
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
'use strict'
const babel = require('gulp-babel')
const browserify = require('browserify')
const gulp = require('gulp')
const rename = require('gulp-rename')
const source = require('vinyl-source-stream')
const uglify = require('gulp-uglify')
/**
* Prepares the files for browser usage
*
* - Boundle with browserify
* - Transpile with Babel
* - Minify with uglify
*/
gulp.task('build', [ 'bundle' ], function () {
gulp.src('./dist/allpaths.js')
.pipe(babel())
.pipe(gulp.dest('./dist'))
.pipe(uglify())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('./dist'))
})
gulp.task('bundle', function () {
let b = browserify({ entries: './libs/Graph.js' })
return b.bundle()
.pipe(source('allpaths.js'))
.pipe(gulp.dest('./dist'))
})