You need to sign in or sign up before continuing.
Newer
Older
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
const gulp = require('gulp')
const nodemon = require('gulp-nodemon')
const notify = require('gulp-notify')
const sass = require('gulp-sass')
const babel = require('gulp-babel')
const sync = require('browser-sync')
const reload = sync.reload
//ALL DEV STUFF NOT FOR PRODUCTION PLS NO TOUCH
//-- TASKS
gulp.task('babel', () => {
return gulp.src('./src/js/*.js')
.pipe(babel({
presets: ['es2015']
}))
.pipe(gulp.dest('./public/js'))
})
gulp.task('browser-sync', ['nodemon'], () => {
sync.init(null, {
proxy: "localhost:3000",
port: 5000,
notify: true
})
})
gulp.task('css', () => {
return gulp.src('./src/scss/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./public/css'))
.pipe(reload({stream:true}))
})
gulp.task('nodemon', (callback) => {
return nodemon({script: 'app.js'}).on('start', callback)
})
gulp.task('serve', ['css', 'browser-sync'], () => {
sync.init({
server: "./app"
})
gulp.watch('./src/scss/*.scss', ['css'])
})