forked from mikemaccana/styleselect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
59 lines (53 loc) · 1.41 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
54
55
56
57
58
59
// Run 'gulp' to do the important stuff
var gulp = require('gulp'),
prefixer = require('gulp-autoprefixer'),
sass = require('gulp-sass'),
livereload = require('gulp-livereload'),
nodemon = require('gulp-nodemon'),
jshint = require('gulp-jshint'),
connect = require('gulp-connect'),
browserify = require('browserify')
source = require('vinyl-source-stream');
var path = require('path');
gulp.task('sass', function () {
gulp
.src('./scss/styleselect.scss')
.pipe(sass({
paths: ['scss']
}))
.pipe(prefixer('last 2 versions', 'ie 9'))
.pipe(gulp.dest('./css'))
.pipe( connect.reload() );
gulp
.src('./scss/main.scss')
.pipe(sass({
paths: ['scss']
}))
.pipe(prefixer('last 2 versions', 'ie 9'))
.pipe(gulp.dest('./css'))
.pipe( connect.reload() );
});
gulp.task('js', function() {
return browserify({
entries: './js/styleselect.js',
standalone: 'styleSelect'
})
.bundle()
.pipe(source('styleselect.js'))
.pipe(gulp.dest('./dist/'))
.pipe( connect.reload() );
});
// The default task (called when you run `gulp`)
gulp.task('default', ['sass', 'js'], function() {
// Watch files and run tasks if they change
gulp.watch('./scss/**/*.*', function(event) {
gulp.run('sass');
});
gulp.watch('./js/styleselect.js', function(event) {
gulp.run('js');
});
connect.server({
port: 4242,
livereload: true
});
});