-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
34 lines (29 loc) · 834 Bytes
/
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
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var connect = require('gulp-connect');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
gulp.task('connect', function () {
connect.server({
root: 'public',
port: 4000
});
});
gulp.task('browserify', function() {
// Grabs the app.js file
return browserify('./app/app.js')
// bundles it and creates a file called main.js
.bundle()
.pipe(source('main.js'))
// saves it the public/js/ directory
.pipe(gulp.dest('./public/js/'));
});
gulp.task('sass', function() {
return sass('scss/style.scss')
.pipe(gulp.dest('public/css'));
});
gulp.task('watch', function() {
gulp.watch('app/**/*.js', ['browserify']);
gulp.watch('scss/style.scss', ['sass']);
});
gulp.task('default', ['connect', 'watch']);