-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
31 lines (26 loc) · 874 Bytes
/
gulpfile.js
File metadata and controls
31 lines (26 loc) · 874 Bytes
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
var gulp = require('gulp');
var concat = require('gulp-concat');
var browserSync = require('browser-sync').create();
gulp.task('server', ['build-libs', 'build-core'], function () {
return browserSync.init({
server: {
baseDir: './dist'
}
});
});
gulp.task('build-core', function () {
return gulp.src(['src/js/core.js', 'src/js/components/**/*.js', 'src/js/modules/**/*.js'])
.pipe(concat('index.js'))
.pipe(gulp.dest('dist/js'))
.pipe(browserSync.reload({stream:true}));
});
gulp.task('build-libs', function () {
return gulp.src('src/js/vendor/**/*.js')
.pipe(concat('libs.js'))
.pipe(gulp.dest('dist/js'))
.pipe(browserSync.reload({stream:true}));
});
gulp.task('watch', function () {
gulp.watch('src/**/*.js', ['build-core']);
});
gulp.task('start', ['server', 'watch']);