-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgulpfile.coffee
43 lines (37 loc) · 1.27 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
gulp = require 'gulp'
$ = require('gulp-load-plugins')()
sourceDirectory = './src/'
scripts = sourceDirectory + '*.coffee'
coffeeLintRules = './coffeelint.json'
scriptsEntryPoint = sourceDirectory + 'index.coffee'
distDirectory = './dist/'
onCoffeelintFailure = (numberOfWarnings, numberOfErrors) =>
$.util.beep()
throw new Error """
CoffeeLint failure; see above.
Warning count: #{numberOfWarnings}.
Error count: #{numberOfErrors}.
"""
gulp.task 'default', ['compile']
gulp.task 'compile', =>
gulp.src(scriptsEntryPoint)
# .pipe($.coffeelint(optFile: coffeeLintRules))
# .pipe($.coffeelint.reporter())
# .pipe($.coffeelintThreshold 0, 0, onCoffeelintFailure)
# .pipe($.coffee({bare:true}))
.pipe($.webpack(
output:
filename: 'gifStop.debug.js'
library: "gifStop"
libraryTarget: "umd"
module:
loaders: [
test: /\.coffee$/, loader: 'coffee-loader'
]
))
.pipe(gulp.dest(distDirectory))
.pipe($.uglify(
mangle: true
))
.pipe($.rename('gifStop.min.js'))
.pipe(gulp.dest(distDirectory))