forked from bumbu/svg-pan-zoom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
44 lines (40 loc) · 893 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
33
34
35
36
37
38
39
40
41
42
43
/**
* Modules
*/
var gulp = require('gulp')
, watch = require('gulp-watch')
, uglify = require('gulp-uglify')
, browserify = require('browserify')
, source = require('vinyl-source-stream')
, streamify = require('gulp-streamify')
, rename = require('gulp-rename')
;
/**
* Build script
*/
gulp.task('build', function() {
return browserify({entries:'./src/svg-pan-zoom.js'})
.bundle()
.on('error', function (err) {
console.log(err.toString())
this.emit("end")
})
.pipe(source('svg-pan-zoom.js'))
.pipe(gulp.dest('./dist/'))
.pipe(streamify(rename('svg-pan-zoom.min.js')))
.pipe(streamify(uglify()))
.pipe(gulp.dest('./dist/'))
});
/**
* Watch script
*/
gulp.task('watch', function () {
gulp.watch('./src/**/*.js', ['build']);
});
/**
* Default task
*/
gulp.task('default', [
'build',
'watch'
]);