forked from gaearon/react-dnd-touch-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.babel.js
60 lines (52 loc) · 1.5 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
50
51
52
53
54
55
56
57
58
59
60
/**
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
*/
import gulp from 'gulp';
import connect from 'gulp-connect';
import del from 'del';
import fs from 'fs';
import babel from 'gulp-babel';
import changelog from 'gulp-changelog';
import { default as js, dist } from './tasks/browserify';
gulp.task('changelog', function(cb){
changelog(require('./package.json')).then(function(stream) {
stream.pipe(gulp.dest('./', {number: 100})).on('end',cb);
});
});
gulp.task('clean', () => {
del.sync(['dist']);
del.sync(['examples/*.browserified.js']);
});
// Compile examples
gulp.task('js-dev', js({
src: './examples/js/index.jsx',
destFilename: 'main.browserified.js',
destFolder: './examples/'
}));
gulp.task('js-dev-drop', js({
src: './examples/dropTarget/js/index.jsx',
destFilename: 'main.browserified.js',
destFolder: './examples/dropTarget/'
}));
// Compile scripts
gulp.task('js-browserify', dist({
src: './src/Touch.js',
destFilename: 'Touch.browserified.js',
destFolder: './dist/'
}));
gulp.task('babel', () => {
return gulp.src('src/**/*')
.pipe(babel())
.pipe(gulp.dest('dist'));
});
gulp.task('connect', () => {
connect.server({
name: 'Example App',
port: 7789,
root: ['examples']
});
});
gulp.task('dev', ['clean', 'js-dev', 'js-dev-drop', 'connect']);
gulp.task('dist', ['clean', 'babel', 'js-browserify']);
gulp.task('default', ['dev']);