forked from adamalbrecht/angular-date-picker-polyfill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.coffee
42 lines (35 loc) · 1.14 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
gulp = require('gulp')
$ = require('gulp-load-plugins')()
packageName = 'angular-date-picker-polyfill'
gulp.task 'scripts', ->
gulp.src(['src/js/**/*.coffee', '!src/js/**/*.spec.coffee'])
.pipe($.plumber({errorHandler: $.util.log}))
.pipe($.coffee())
.pipe($.ngAnnotate())
.pipe($.concat("#{packageName}.js"))
.pipe(gulp.dest('dist'))
.pipe($.uglify())
.pipe($.rename({suffix: '.min'}))
.pipe(gulp.dest('dist'))
gulp.task 'stylesheets', ->
gulp.src(['src/css/**/*.scss'])
.pipe($.plumber({errorHandler: $.util.log}))
.pipe($.sass({
outputStyle: 'nested',
errLogToConsole: true
}))
.pipe($.rename({prefix: packageName + "-"}))
.pipe(gulp.dest('dist'))
.pipe($.minifyCss())
.pipe($.rename({suffix: '.min'}))
.pipe(gulp.dest('dist'))
gulp.task 'watch', ->
gulp.watch('src/js/**/*.coffee', ['scripts'])
gulp.watch('src/css/**/*.scss', ['stylesheets'])
gulp.task 'clean', ->
return gulp.src(["dist"], {read: false})
.pipe($.rimraf({force: true}))
gulp.task 'compile', ['clean'], ->
gulp.start('scripts', 'stylesheets')
gulp.task 'dev', ['compile'], ->
gulp.start('watch')