-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
50 lines (45 loc) · 1.08 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
47
48
49
50
var gulp = require('gulp');
var sass = require('gulp-sass');
var webpack = require('gulp-webpack');
var connect = require('gulp-connect');
var scripts =
{
compile: function()
{
return gulp.src('./src/js/main')
.pipe(webpack(require('./webpack-config')))
.pipe(gulp.dest('./public/js/'));
}
}
var scss =
{
// Compile SCSS into CSS
compile: function()
{
gulp.src('./src/scss/main.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./public/css'));
},
// Watch SCSS for changes
watch: function()
{
gulp.watch('./src/scss/**/**/*.scss', ['scss']);
}
}
var http =
{
serve: function()
{
return connect.server({
root: 'public',
port: 8080,
host: '0.0.0.0',
});
}
}
gulp.task('default', ['scripts', 'scss', 'serve', 'scss:watch']);
gulp.task('fetch', ['scripts', 'scss']);
gulp.task('scripts', scripts.compile);
gulp.task('scss', scss.compile);
gulp.task('scss:watch', scss.watch);
gulp.task('serve', http.serve);