This repository was archived by the owner on Apr 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.coffee
executable file
·60 lines (50 loc) · 1.63 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
gulp = require('gulp')
coffee = require('gulp-coffee')
coffeelint = require('gulp-coffeelint')
concat = require('gulp-concat')
uglify = require('gulp-uglify')
del = require('del')
html2js = require('gulp-html2js')
sass = require('gulp-sass')
ngAnnotate = require('gulp-ng-annotate')
gulp.task 'styles', ->
gulp.src 'sass/**/*.scss'
.pipe sass({errLogToConsole: true})
.pipe concat('styles.css')
.pipe gulp.dest('dist')
gulp.task 'lint', ->
gulp.src 'src/**/*.coffee'
.pipe coffeelint('coffeelint.json')
.pipe coffeelint.reporter()
.pipe coffeelint.reporter('fail')
gulp.task 'coffee', ['lint'], ->
gulp.src 'src/**/*.coffee'
.pipe coffee({bare: true})
.pipe ngAnnotate()
.pipe gulp.dest('.tmp/compiled')
gulp.task 'scripts.normal', ['coffee'], ->
gulp.src '.tmp/compiled/**/*.js'
.pipe concat('module.js')
.pipe gulp.dest('dist')
gulp.task 'scripts.min', ['coffee'], ->
gulp.src '.tmp/compiled/**/*.js'
.pipe concat('module.min.js')
.pipe uglify()
.pipe gulp.dest('dist')
gulp.task 'templates', ->
gulp.src 'templates/*.html'
.pipe html2js(
outputModuleName: 'AnalyticalObjectWysiwygTemplates'
useStrict: true
)
.pipe concat('templates.min.js')
.pipe uglify()
.pipe gulp.dest('dist')
gulp.task 'scripts', ['scripts.normal', 'scripts.min']
gulp.task 'clean', ->
del ['.tmp', 'dist/*', '!dist/bower_components']
gulp.task 'watch', ['scripts.normal', 'templates'], ->
gulp.watch 'src/**/*.coffee', ['scripts.normal']
gulp.watch 'sass/**/*.scss', ['styles']
gulp.watch 'templates/*.html', ['templates']
gulp.task 'default', ['clean', 'scripts', 'styles', 'templates']