-
Notifications
You must be signed in to change notification settings - Fork 31
/
gulpfile.babel.js
49 lines (43 loc) · 1.14 KB
/
gulpfile.babel.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
/**
*
* Gulpfile for validate.js
*
* @author Daniel Leite de Oliveira <[email protected]>
*
*/
import gulp from 'gulp';
import uglify from 'gulp-uglify';
import buffer from 'vinyl-buffer';
import browserify from 'browserify';
import babelify from 'babelify';
import es6ify from 'es6ify';
import deglobalify from 'deglobalify';
import source from 'vinyl-source-stream';
import connect from 'gulp-connect';
gulp.task('browserify', () => {
browserify({
entries: './src/validate.js',
transform: [babelify, es6ify, deglobalify],
// Generate a UMD bundle for the supplied export name.
// This bundle works with other module systems and sets the name
// given as a window global if no module system is found.
standalone: 'valid.js',
// Enable source maps that allow you to debug your files
// separately.
debug: true
})
.bundle()
.pipe(source('validate.js'))
.pipe(buffer())
.pipe(uglify())
.pipe(gulp.dest('dist'))
.pipe(gulp.dest('public'));
});
gulp.task('server', () => {
connect.server({
root: ['public', 'dist'],
port: 8000,
livereload: true
});
});
gulp.task('default', ['browserify'], () => {});