-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
36 lines (30 loc) · 884 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
29
30
31
32
33
34
35
36
const gulp = require('gulp');
const browserSync = require('browser-sync').create();
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const concat = require('gulp-concat');
const fs = require('fs');
gulp.task('convertjs', function(){
return gulp.src('./src/**/*.js')
//.pipe(cache('js'))
.pipe(gulp.dest('./demo/js'))
.pipe(concat('MaterialGraph.js'))
.pipe(gulp.dest('./dist'))
.pipe(uglify())
.pipe(rename('MaterialGraph.min.js'))
.pipe(gulp.dest('./dist'));
});
gulp.task('watchjs', ['convertjs'], function(){
browserSync.reload();
});
gulp.task('browser-sync', function(){
browserSync.init({
server: {
baseDir: "./demo"
}
});
});
gulp.task('watch', function(){
gulp.watch('./src/**/*.js', ['watchjs']);
});
gulp.task('run', ['browser-sync', 'watch']);