-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (39 loc) · 1.17 KB
/
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
37
38
39
40
41
42
43
44
45
46
var gulp = require('gulp'),
browserify = require("browserify"),
source = require('vinyl-source-stream'),
babelify = require("babelify"),
webserver = require('gulp-webserver'),
sass = require('gulp-sass');
var source_paths = {
sass: './source/sass/**/*.scss',
js: './source/js/app.js',
all_js: './source/js/**/*.js',
html: './source/html/**/*.html',
}
gulp.task('sass', function() {
gulp.src(source_paths.sass)
.pipe(sass.sync().on('error', sass.logError))
.pipe(gulp.dest('./build/css'));
})
gulp.task('copy', function() {
gulp.src(source_paths.html)
.pipe(gulp.dest('./build'));
})
gulp.task('bowersify', function() {
browserify([source_paths.js], {
transform: ['babelify']
})
.bundle()
.pipe(source('app.js'))
.pipe(gulp.dest('./build/js/'));
})
gulp.task('watch', ['sass','bowersify','copy'], function() {
gulp.watch(source_paths.sass, ['sass'])
gulp.watch(source_paths.all_js, ['bowersify'])
gulp.watch(source_paths.html, ['copy'])
});
gulp.task('webserver', ['watch'],function() {
gulp.src('build')
.pipe(webserver({open: true, livereload: true}));
});
gulp.task('default', ['webserver']);