-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
53 lines (46 loc) · 1.24 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
51
52
53
'use strict';
var gulp = require('gulp');
var install = require("gulp-install");
var nodemon = require("gulp-nodemon");
var jshint = require('gulp-jshint');
var sass = require('gulp-ruby-sass');
var fse = require("fs-extra");
var exec = require('child_process').exec;
var wiredep = require('wiredep').stream;
var rename = require('gulp-rename');
gulp.task('install', function() {
gulp.src(['./bower.json']).pipe(install());
if(!fse.existsSync('./app/partials')) fse.mkdirSync('./app/partials');
});
gulp.task('bower', function () {
gulp.src('app/layouts/index.hbs')
.pipe(wiredep({
ignorePath: '..'
}))
.pipe(gulp.dest('app/layouts'));
});
gulp.task('sass', function() {
sass('app/static/style/style.scss', {
style : "compact",
compass : true,
trace: false
})
.pipe(gulp.dest('app/static/style'));
});
gulp.task('lint', function () {
gulp.src('./app/**/*.js')
.pipe(jshint())
});
gulp.task('server', ['sass', 'lint'], function() {
nodemon({
script: 'app/server.js',
ext: 'html js hbs scss json',
ignore: ['ignored.js'],
nodeArgs: ['--harmony']
})
.on('change', ['sass', 'lint'])
.on('restart', function () {
console.log('restarted!')
})
});
gulp.task('default', ['server']);