-
Notifications
You must be signed in to change notification settings - Fork 19
/
gulpfile.js
29 lines (24 loc) · 858 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
'use strict';
const gulp = require('gulp'),
browserify = require('browserify'),
source = require('vinyl-source-stream'),
browserSync = require('browser-sync').create();
gulp.task('demo', ['build:demo'], () => {
browserSync.init({
server: "./demo"
});
gulp.watch('./src/*.js', ['build:demo']);
gulp.watch('./demo/index.html').on('change', browserSync.reload);
gulp.watch('./demo/demo.js').on('change', browserSync.reload);
})
gulp.task('build:demo', () => {
return browserify({debug: true, extensions: ['.js']})
.require('./lib/dtmf', {expose: 'dtmf'})
.require('./index', {expose: 'goertzeljs'})
.transform('babelify', {presets: ['es2015']})
.bundle()
.pipe(source('bundle.js'))
.pipe(gulp.dest('./demo'))
.pipe(browserSync.stream());
});
gulp.task('default', ['demo']);