-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (44 loc) · 1.11 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
'use strict';
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
nodemon = require('gulp-nodemon'),
install = require('gulp-install'),
lr = require('gulp-livereload');
var PUBLIC_DIR = 'public_html/';
var SCSS_SRC = PUBLIC_DIR + 'assets/scss/**/*.scss';
var CSS_DIR = PUBLIC_DIR + 'assets/css/';
var SERVER_DIR = 'server/**/*.js';
var SERVER_FILE = 'server/server.js';
var JS_SRC = PUBLIC_DIR + '**/*.js';
gulp.task('styles',function () {
return sass(SCSS_SRC)
.pipe(gulp.dest(CSS_DIR))
.pipe(lr());
});
gulp.task('html',function(){
gulp.src(PUBLIC_DIR + "/**/*.html")
.pipe(lr());
});
gulp.task('scripts',function(){
gulp.src(JS_SRC)
.pipe(lr());
});
gulp.task('watch',function(){
lr.listen();
gulp.watch(JS_SRC, ['scripts']);
gulp.watch(SCSS_SRC, ['styles']);
gulp.watch("**/*.html", ['html']);
});
gulp.task('start', function () {
nodemon({
script: SERVER_FILE,
ext: 'js',
env: { 'NODE_ENV': 'development' },
watch: [SERVER_DIR]
})
});
gulp.task("install",function(){
gulp.src(['./package.json2'])
.pipe(install());
});
gulp.task('default', ['install','styles','watch','start']);