-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.coffee
31 lines (27 loc) · 963 Bytes
/
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
gulp = require 'gulp'
argv = require('yargs').argv
gulpif = require 'gulp-if'
rename = require 'gulp-rename'
uglify = require 'gulp-uglify'
coffee = require 'gulp-coffee'
include = require 'gulp-include'
insert = require 'gulp-insert'
sourcemaps = require 'gulp-sourcemaps'
bower_config = require './bower.json'
copyrights = "/* Afterlag.js #{bower_config.version} — #{bower_config.description} Author: #{bower_config.author.name} (#{bower_config.author.web}). Licensed MIT. */\n"
gulp.task 'scripts', ->
gulp.src('src/*.coffee')
.pipe gulpif !argv.production, sourcemaps.init()
.pipe include()
.pipe coffee()
.pipe insert.prepend copyrights
.pipe gulp.dest 'dist'
.pipe uglify()
.pipe gulpif !argv.production, sourcemaps.write()
.pipe rename
suffix: '.min'
.pipe insert.prepend copyrights
.pipe gulp.dest 'dist'
gulp.task 'watch', ->
gulp.watch 'src/*.coffee', ['scripts']
gulp.task 'default', ['scripts']