-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathgulpfile.js
39 lines (35 loc) · 1.11 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
var gulp = require( 'gulp' ),
buffer = require( 'vinyl-buffer' ),
uglify = require( 'gulp-uglify' ),
rename = require( 'gulp-rename' ),
source = require('vinyl-source-stream'),
watchify = require('watchify'),
browserify = require('browserify'),
gbrowserify = require( 'gulp-browserify' );
gulp.task( 'client', function(){
var out = gulp.src( './index.js')
.pipe( gbrowserify({ standalone:'Interface', bare:true }) )
.pipe( rename('interface.js') )
.pipe( gulp.dest('./build') )
.pipe( buffer() )
.pipe( uglify() )
.pipe( rename('interface.min.js') )
.pipe( gulp.dest('./build/') )
return out
});
// gulp.task('watch', function() {
// var bundler = watchify(browserify('./js/main.js', watchify.args));
//
// bundler.on('update', rebundle);
//
// function rebundle() {
// return bundler.bundle()
// .on('error', gutil.log.bind(gutil, 'Browserify Error'))
// .pipe( source( 'bundle.js' ) )
// .pipe( rename( 'index.js' ) )
// .pipe( gulp.dest( './js' ) )
// }
//
// return rebundle();
// });
gulp.task( 'default', ['client'] )