-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.coffee
39 lines (32 loc) · 984 Bytes
/
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
gulp = require 'gulp'
coffee = require 'gulp-coffee'
gutil = require 'gulp-util'
watch = require 'gulp-watch'
cjsx = require 'gulp-cjsx'
browserify = require 'browserify'
transform = require 'vinyl-transform'
sass = require('gulp-sass')
gulp.task 'default', ['coffee', 'cjsx', 'browserify', 'sass']
gulp.task 'watch', ->
gulp.watch('./src/**/*.*', ['default'])
gulp.task 'coffee', ->
gulp
.src('./src/**/*.coffee')
.pipe(coffee(bare: true).on('error', gutil.log))
.pipe gulp.dest('./dist')
gulp.task 'cjsx', ->
gulp
.src('./src/**/*.cjsx')
.pipe(cjsx(bare: true).on('error', gutil.log))
.pipe(gulp.dest('./dist'))
gulp.task 'sass', ->
gulp.src('./src/scss/**/*.scss')
.pipe(sass())
.pipe(gulp.dest('./browser/css'));
gulp.task 'browserify', ->
browserified = transform (filename) ->
b = browserify(entries: filename)
return b.bundle()
gulp.src('./dist/common.js')
.pipe(browserified)
.pipe(gulp.dest('./browser/js'))