-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.coffee
executable file
·49 lines (35 loc) · 1.55 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
gulp = require('gulp')
gutil = require('gulp-util')
coffee = require('gulp-coffee')
concat = require('gulp-concat')
uglify = require('gulp-uglify')
sass = require('gulp-sass')
ngAnnotate = require('gulp-ng-annotate')
gulp.task 'frontendScripts', ->
gulp.src('./src/frontend/scripts/**/*.coffee')
.pipe(coffee(bare: true).on('error', gutil.log))
.pipe(ngAnnotate().on('error', gutil.log))
.pipe(concat('index.js')).on('error', gutil.log)
.pipe(uglify()).on('error', gutil.log)
.pipe(gulp.dest('./dist/frontend/scripts/'))
gulp.task 'frontendStyles', ->
gulp.src('./src/frontend/styles/main.scss')
.pipe(sass()).on('error', gutil.log)
.pipe(gulp.dest('./dist/frontend/styles/'))
gulp.task 'frontendViews', ->
gulp.src('./src/frontend/views/**/*.html')
.pipe(gulp.dest('./dist/frontend/views'))
gulp.task 'adminScripts', ->
gulp.src('./src/admin/scripts/**/*.coffee')
.pipe(coffee(bare: true).on('error', gutil.log))
.pipe(ngAnnotate().on('error', gutil.log))
.pipe(concat('index.js')).on('error', gutil.log)
.pipe(uglify()).on('error', gutil.log)
.pipe(gulp.dest('./dist/admin/scripts/'))
gulp.task 'watch', ->
gulp.watch('./src/frontend/scripts/**/*.coffee', ['frontendScripts'])
gulp.watch('./src/frontend/styles/**/*.scss', ['frontendStyles'])
gulp.watch('./src/frontend/views/**/*.html', ['frontendViews'])
gulp.watch('./src/admin/scripts/**/*.coffee', ['adminScripts'])
gulp.task 'build', ['frontendScripts', 'frontendStyles', 'frontendViews', 'adminScripts']
gulp.task 'default', ['build', 'watch']