-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
35 lines (29 loc) · 1001 Bytes
/
gulpfile.babel.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
import gulp from 'gulp'
import runSequence from 'run-sequence'
import './gulp/build'
import './gulp/production'
import './gulp/utils'
import EXTRAS_GLOB from './gulp/build'
gulp.task('build', (done) => {
runSequence('clean', ['browserify', 'sass', 'extras'], done)
})
gulp.task('build:production', (done) => {
runSequence('build', ['minify:css', 'minify:js'], done)
})
gulp.task('watch', ['build', 'watchify'], () => {
const browserSync = require('browser-sync').create()
browserSync.init({
ghostMode: false,
proxy: '127.0.0.1:' + (parseInt(process.env.PORT, 10) - 100), // subtract 100 because foreman adds 100 to each success worker in the Procfile
files: './sarahjaine/static/**/*',
open: false,
port: process.env.PORT,
ui: {
port: (parseInt(process.env.PORT, 10) + 1)
}
})
// watchify task handles js files
gulp.watch('./sarahjaine/static_src/scss/**/*.scss', ['sass'])
gulp.watch(EXTRAS_GLOB, ['extras'])
})
gulp.task('default', ['build'])