forked from romeo-whiskey/jquery.vamoose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (42 loc) · 1.31 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
const gulp = require('gulp');
const bs = require('browser-sync').create(); // create a browser sync instance.
const babel = require('gulp-babel');
const plumber = require('gulp-plumber');
// const concat = require('gulp-concat');
const sass = require('gulp-sass');
const autoprefixer = require('gulp-autoprefixer');
gulp.task('browser-sync', ['css', 'js'],function() {
bs.init({
server: {
baseDir: "./"
},
// proxy: "localhost:8080" // makes a proxy for localhost:8080
});
});
gulp.task('watch', ['browser-sync'], function () {
// gulp.watch("scss/*.scss", ['sass']);
gulp.watch("index.html").on('change', bs.reload);
gulp.watch(["*.js", '!gulpfile.js'], ['js']);
gulp.watch(["scss/*.s{a,c}ss"], ['css']);
});
gulp.task('css', () => {
bs.reload();
return gulp.src('./scss/**/*.*')
.pipe(plumber())
.pipe(sass.sync().on('error', sass.logError))
// .pipe(autoprefixer())
.pipe(gulp.dest('demo/css'));
});
gulp.task('js', () => {
bs.reload();
return gulp.src(['*.js', '!_*.js', '!gulpfile.js'])
.pipe(plumber())
// .pipe(concat('concat.js'))
.pipe(babel({
"presets": [
"env",
"babel-preset-stage-3"
]
}))
.pipe(gulp.dest('demo/js'));
});