forked from jessepollak/card
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.coffee
54 lines (46 loc) · 1.41 KB
/
gulpfile.coffee
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
gulp = require 'gulp'
browserify = require 'gulp-browserify'
scss = require 'gulp-sass'
prefix = require 'gulp-autoprefixer'
spawn = require('child_process').spawn
server = require('tiny-lr')()
livereload = require('gulp-livereload')
rename = require 'gulp-rename'
rimraf = require 'gulp-rimraf'
connect = require 'gulp-connect'
open = require 'gulp-open'
runs = require 'run-sequence'
development = process.env.NODE_ENV == 'development'
gulp.task 'scss', ->
gulp.src ['./src/scss/**/*.scss']
.pipe scss().on('error', console.log)
.pipe prefix("> 1%")
.pipe livereload(server)
.pipe gulp.dest('./lib/css')
gulp.task 'browserify', ->
gulp.src './src/coffee/**/*.coffee', read: false
.pipe browserify
insertGlobals: false
debug: development
transform: ['coffeeify']
extensions: ['.coffee']
.pipe livereload(server)
.pipe rename({ extname: '.js' })
.pipe gulp.dest('./lib/js')
gulp.task 'watch', ['scss', 'browserify', 'connect'], ->
server.listen 35729, ->
gulp.watch './src/scss/**/*.scss', ['scss']
gulp.watch './src/coffee/**/*.coffee', ['browserify']
gulp.src('example/index.html')
.pipe open("", url: "http://localhost:8080/example")
gulp.task 'connect', ->
connect.server()
gulp.task 'clean', ->
gulp.src 'build'
.pipe rimraf()
# Default task call every tasks created so far.
gulp.task 'default', (cb) ->
runs(
'clean'
['scss', 'browserify']
cb)