2014-10-31 13:48:53 +00:00
|
|
|
path = require('path')
|
2014-10-31 13:37:29 +00:00
|
|
|
gulp = require('gulp')
|
2014-12-30 13:44:03 +00:00
|
|
|
coffee = require('gulp-coffee')
|
2017-11-23 12:49:47 +00:00
|
|
|
inlinesource = require('gulp-inline-source')
|
2014-12-30 17:12:18 +00:00
|
|
|
shell = require('gulp-shell')
|
|
|
|
packageJSON = require('./package.json')
|
2014-10-31 13:37:29 +00:00
|
|
|
|
|
|
|
OPTIONS =
|
2014-10-31 13:50:50 +00:00
|
|
|
files:
|
|
|
|
coffee: [ 'lib/**/*.coffee', 'gulpfile.coffee' ]
|
2017-11-23 12:49:47 +00:00
|
|
|
app: 'lib/**/*.coffee'
|
2019-08-07 11:31:03 +00:00
|
|
|
tests: 'tests/**/*.spec.js'
|
2017-11-23 12:49:47 +00:00
|
|
|
pages: 'lib/auth/pages/*.ejs'
|
2014-12-24 19:12:31 +00:00
|
|
|
directories:
|
2014-12-30 13:44:03 +00:00
|
|
|
build: 'build/'
|
2014-12-24 19:12:31 +00:00
|
|
|
|
2017-11-23 12:49:47 +00:00
|
|
|
gulp.task 'pages', ->
|
|
|
|
gulp.src(OPTIONS.files.pages)
|
|
|
|
.pipe(inlinesource())
|
|
|
|
.pipe(gulp.dest('build/auth/pages'))
|
|
|
|
|
2018-01-04 14:07:55 +00:00
|
|
|
gulp.task 'coffee', ->
|
2014-12-30 13:44:03 +00:00
|
|
|
gulp.src(OPTIONS.files.app)
|
2017-03-22 09:46:06 +00:00
|
|
|
.pipe(coffee(bare: true, header: true))
|
2014-12-30 13:44:03 +00:00
|
|
|
.pipe(gulp.dest(OPTIONS.directories.build))
|
|
|
|
|
2019-05-02 09:26:53 +00:00
|
|
|
gulp.task 'build', gulp.series [
|
2017-11-23 12:49:47 +00:00
|
|
|
'coffee',
|
|
|
|
'pages'
|
|
|
|
]
|
|
|
|
|
2019-05-02 09:26:53 +00:00
|
|
|
gulp.task 'watch', gulp.series [ 'build' ], ->
|
2017-11-23 12:49:47 +00:00
|
|
|
gulp.watch([ OPTIONS.files.coffee ], [ 'build' ])
|