-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
37 lines (32 loc) · 1.1 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
var gulp = require('gulp');
var browserify = require('browserify');
var babel = require('gulp-babel');
var babelify = require('babelify');
var uglify = require('gulp-uglify');
var rename = require("gulp-rename");
var buffer = require('vinyl-buffer');
var source = require('vinyl-source-stream');
gulp.task('browser', function () {
return browserify({entries: './index.js', extensions: ['.js'], debug: true, basedir: __dirname + '/src', standalone: 'scriptutils'})
.ignore('./src/hash/index.js')
.ignore('./src/promise/index.js')
.ignore('./src/other/timeout.js')
.transform(babelify)
.bundle()
.pipe(source('index.js'))
.pipe(buffer())
.pipe(uglify())
.pipe(rename("index.js"))
.pipe(gulp.dest("./dist/browser"))
});
gulp.task('node', function () {
return gulp.src("./src/**")
.pipe(babel())
.pipe(gulp.dest("./dist/node"))
})
gulp.task('node-test', function () {
return gulp.src("./src/**")
.pipe(babel({plugins: ["istanbul"]}))
.pipe(gulp.dest("./dist/node-test"))
})
gulp.task('default', gulp.series('browser', 'node'))