-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.coffee
74 lines (66 loc) · 1.71 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
gulp = require 'gulp'
minifyCSS = require 'gulp-clean-css'
rename = require 'gulp-rename'
browserSync = require('browser-sync').create()
uglify = require 'gulp-uglify'
plumber = require 'gulp-plumber'
stylus = require 'gulp-stylus'
nib = require 'nib'
coffee = require 'gulp-coffee'
gutil = require 'gulp-util'
ServerTest = require('karma').Server
supervisor = require 'gulp-supervisor'
gulp.task 'test', ->
new ServerTest
configFile:__dirname + '/karmaCfg.js'
.start()
gulp.task 'coffee', ->
gulp.src 'coffee/*.coffee'
.pipe do plumber
.pipe coffee
bare:true
.on 'error', gutil.log
.pipe gulp.dest 'public/js/'
gulp.task 'uglify', ['coffee'], ->
gulp.src 'scripts/*.js'
.pipe do uglify
.pipe rename
suffix: '.min'
.pipe gulp.dest 'public/js/'
gulp.task 'stylus', ->
gulp.src 'stylus/main.styl'
.pipe do plumber
.pipe stylus
use: do nib
.pipe gulp.dest 'stylus'
gulp.task 'buildCSS', ['stylus'], ->
gulp.src 'stylus/main.css'
.pipe minifyCSS
keepSpecialComments:0
compability:true
noAdvanced:false
.pipe rename 'main.min.css'
.pipe gulp.dest 'public/css'
gulp.task 'browser-sync',['buildCSS'], ->
browserSync.init null,
proxy: 'http://localhost:3000'
files: ['public/**/*.*', 'views/*.pug']
browser: 'chrome'
port: 5000
gulp.task 'supervisor', ['buildCSS'], ->
supervisor 'app.js',
args:[]
watch:[]
ignore:['node_modules','bower','views','public','stylus','images','coffee']
pollInterval:500
extensions:[]
exec:'node'
debug:false
debugBrk:false
harmony:true
noRestartOn:'exit'
forceWatch:true
quiet:false
gulp.task 'default', ['supervisor', 'browser-sync'], ->
gulp.watch ['stylus/main.styl'], ['buildCSS']
gulp.watch ['coffee/*.coffee'], ['uglify']