-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.coffee
52 lines (43 loc) · 1.38 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
gulp = require 'gulp'
gutil = require 'gulp-util'
coffee = require 'gulp-coffee'
browserify = require 'gulp-browserify'
rename = require 'gulp-rename'
connect = require 'gulp-connect'
gbump = require 'gulp-bump'
gulp.task 'watch', ->
gulp.watch './src/**/*', ['build']
gulp.watch './test/**/*', ['build:tests']
bump = (type) ->
gulp.src ['./bower.json', './package.json']
.pipe gbump {type}
.pipe gulp.dest './'
gulp.task 'bump:major', -> bump 'major'
gulp.task 'bump:minor', -> bump 'minor'
gulp.task 'bump:patch', -> bump 'patch'
gulp.task 'build:node', ->
gulp.src './src/*.?(lit)coffee'
.pipe coffee(bare: true).on('error', gutil.log)
.pipe gulp.dest('./lib')
gulp.task 'build:browser', ['build:node'], ->
gulp.src './lib/*.js'
.pipe browserify
standalone: 'mediaswitch'
transform: ['browserify-shim']
.pipe rename('react-mediaswitch.js')
.pipe gulp.dest('./standalone/')
gulp.task 'build:tests', ->
gulp.src './test/**/*.?(lit)coffee'
.pipe coffee().on('error', gutil.log)
.pipe browserify
transform: ['browserify-shim']
.pipe gulp.dest('./test/')
# A server for the test page
gulp.task 'testserver', connect.server
root: [__dirname]
port: 1337
open:
file: 'test/index.html'
browser: 'Google Chrome'
gulp.task 'test', ['build:browser', 'build:tests', 'testserver']
gulp.task 'build', ['build:node', 'build:browser']