-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgulpfile.coffee
More file actions
81 lines (72 loc) · 2.05 KB
/
gulpfile.coffee
File metadata and controls
81 lines (72 loc) · 2.05 KB
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
75
76
77
78
79
80
81
gulp = require 'gulp'
gutil = require 'gulp-util'
rimraf = require 'gulp-rimraf'
rename = require 'gulp-rename'
plumber = require 'gulp-plumber'
compass = require 'gulp-compass'
minify = require 'gulp-minify-css'
header = require 'gulp-header'
bump = require 'gulp-bump'
watch = require 'gulp-watch'
runSequence = require 'run-sequence'
banner =
long: """
/**
* <%= pkg.name %> - <%= pkg.description %>
* version: <%= pkg.version %>
* repository: <%= pkg.homepage %>
* license: <%= pkg.license %>
* author: <%= pkg.author.name %> (<%= pkg.author.email %>)
* build: #{new Date()}
**/
"""
short: "/* <%= pkg.name %> v<%= pkg.version %> | build: #{new Date()} */\n"
paths =
src: 'sass'
dest: 'dist'
gulp.task 'clean', ->
gulp.src("#{paths.dest}", {read: false})
.pipe(rimraf())
gulp.task 'dev', ->
gulp.src("#{paths.src}/**/*.scss")
.pipe(plumber({
errorHandler: (err)->
gutil.beep()
console.log err
}))
.pipe(compass({
sass: paths.src
css: paths.dest
style: 'expanded'
}).on('error', gutil.log))
gulp.task 'prod', ['clean'], ->
pkg = require './package.json'
gutil.log gutil.colors.black.bgYellow(" Generating Production Build ")
gulp.src("#{paths.src}/**/*.scss")
.pipe(plumber({
errorHandler: (err)->
gutil.beep()
console.log err
}))
.pipe(compass({
sass: paths.src
css: paths.dest
style: 'expanded'
environment: 'production'
}).on('error', gutil.log))
.pipe(header(banner.long, {pkg: pkg}))
.pipe(gulp.dest(paths.dest))
.pipe(minify())
.pipe(header(banner.short, {pkg: pkg}))
.pipe(rename('aegis.min.css'))
.pipe(gulp.dest(paths.dest))
gulp.task 'bump', ->
gulp.src(['./bower.json', './package.json'])
.pipe(bump()) # Bump version
.pipe(gulp.dest './')
gulp.task 'watch', ->
watch {glob: "#{paths.src}/**/*.scss"}, ['compass']
gulp.task 'default', ['watch']
gulp.task 'publish', ->
runSequence 'bump', 'prod', ->
gutil.log gutil.colors.black.bgCyan(" You can publish to git now ")