-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
44 lines (35 loc) · 951 Bytes
/
gulpfile.js
File metadata and controls
44 lines (35 loc) · 951 Bytes
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
// Include gulp
var gulp = require('gulp');
// Include other required plugins
var sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps');
webserver = require('gulp-webserver');
// Local webserver setup with livereload.
gulp.task('webserver', function() {
gulp.src('./')
.pipe(webserver({
livereload: true,
open: true,
port: 9000,
host: '0.0.0.0'
}));
});
// sass compiler for general main.css
gulp.task('sass', function () {
return gulp.src([
'src/sass/main.scss',
])
.pipe(sourcemaps.init())
.pipe(sass({
outputStyle: 'expanded',
}))
.on('error', sass.logError)
.pipe(sourcemaps.write())
.pipe(gulp.dest('./src/css'))
});
// Watch Files For Changes and run
gulp.task('watch', function() {
gulp.watch('src/sass/**/*.scss', ['sass']);
});
// Run webserver and watch tasks together
gulp.task('run', ['webserver', 'watch']);