-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgulpfile.coffee
59 lines (49 loc) · 1.77 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
55
56
57
58
59
'use strict'
config = require './gulp/config'
util = require './gulp/util'
gulp = require 'gulp'
# Load custom tasks from the `tasks` directory
try
(require 'require-dir')('./gulp/tasks', { recurse: true })
catch err
console.error err
$ = (require 'gulp-load-plugins')()
runSequence = require 'run-sequence'
browserSync = require 'browser-sync'
reload = browserSync.reload
# Compile source
gulp.task 'build', ['styles', 'coffeelint', 'coffee']
# Watch Files For Changes & Reload
gulp.task 'serve', () ->
browserSync.init(
notify: false,
# Customize the BrowserSync console logging prefix
logPrefix: 'Starter Kit',
# Run as an https by uncommenting 'https: true'
# Note: this uses an unsigned certificate which on first access
# will present a certificate warning in the browser.
# https: true,
# host: '192.168.1.1',
# port: 3000,
server:
baseDir: [ config.path.htdocs ]
index: 'index.html'
# routes:
)
# default
$.watch([config.path.htdocs + '**/*.html'], reload)
$.watch([config.path.jade + '**/*.jade'], -> runSequence('jade', reload))
$.watch([
config.sass.lib,
config.path.scss_common + '**/*.scss',
config.path.scss + '**/*.scss'
], -> runSequence('styles', reload))
# $.watch([config.path.js + '**/*.js'], reload)
$.watch([config.path.coffee + '**/*.coffee'], -> runSequence('coffeelint', 'coffee', reload))
# Build Production Files, the Default Task
gulp.task 'default', (cb) ->
runSequence('build', 'serve', cb)
gulp.task 'deploy', (cb) ->
runSequence('build', 'coffeelint', 'stylestats', cb)
# gulp.task 'minify', (cb) ->
# runSequence('minify:html', 'minify:styles', 'minify:scripts', cb)