-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.coffee
50 lines (40 loc) · 1.8 KB
/
build.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
#
# It's common build code that is used from local gulpfile.coffee and from gulpfile.coffee of a final application
#
module.exports = (path, {gulp, coffee, compass, minifyCSSGulp, concat, uglify, header, rename, wrap, gutil}) ->
pkg = require('./package.json')
banner = "/*! #{ pkg.name } #{ pkg.version } */\n"
gulp.task 'default', ['dst-uglify', 'dst-build'], ->
gulp.task 'dst-build', ['dst-minimized-css', 'dst-uglify'], ->
gulp.watch ["#{path}/theme/ngApp/sass/**/*.sass", "#{path}/app/views/sass/**/*.scss"], ['dst-minimized-css']
gulp.watch "#{path}/app/ngApp/**/*.coffee", ['dst-uglify']
gulp.task 'dst-sass', ->
gulp.src(["#{path}/theme/ngApp/sass/*.sass", "#{path}/theme/ngApp/sass/*.scss"])
.pipe(compass(
sass: "#{path}/theme/ngApp/sass"
css: "#{path}/static/ngApp/css"
require: ['susy', 'breakpoint', 'modular-scale']
))
.pipe(gulp.dest("#{path}/static/ngApp/css"))
gulp.task 'dst-minimized-css', ['dst-sass'], ->
gulp.src("#{path}/static/ngApp/css/dscommon-theme-1407.css")
.pipe(minifyCSSGulp())
.pipe(rename('dscommon-theme-1407.min.css'))
.pipe(gulp.dest("#{path}/static/ngApp/css"))
gulp.task 'dst-coffee', ->
gulp.src("#{path}/app/ngApp/**/*.coffee")
.pipe(coffee())
.on('error', gutil.log)
.on('error', gutil.beep)
.pipe(gulp.dest("#{path}/static/ngApp/js/coffee"))
gulp.task 'dst-concat', ['dst-coffee'], ->
gulp.src("#{path}/static/ngApp/js/coffee/**/*.js")
.pipe(concat('dscommon-theme.js'))
.pipe(header(banner))
.pipe(gulp.dest("#{path}/static/ngApp/js"))
gulp.task 'dst-uglify', ['dst-concat'], ->
gulp.src("#{path}/static/ngApp/js/dscommon-theme.js")
.pipe(uglify())
.pipe(header(banner))
.pipe(rename('dscommon-theme.min.js'))
.pipe(gulp.dest("#{path}/static/ngApp/js"))