2016-02-02 22:01:32 +00:00
|
|
|
g = require('gulp')
|
|
|
|
g.p = require('gulp-load-plugins')()
|
|
|
|
g.d = require('del')
|
|
|
|
|
|
|
|
g.config =
|
|
|
|
bowerDir: 'vendor/bower',
|
|
|
|
assetsDir: './source/assets',
|
|
|
|
sassPattern: './sass/**/*.scss',
|
|
|
|
production: !!g.p.util.env.production,
|
|
|
|
sourceMaps: !g.p.util.env.production,
|
|
|
|
liveReload: !g.p.util.env.production
|
|
|
|
|
|
|
|
g.copy = (srcFiles, outputDir) ->
|
2016-02-03 19:24:47 +00:00
|
|
|
g.src srcFiles
|
|
|
|
.pipe g.dest outputDir
|
|
|
|
|
|
|
|
g.css = (srcFiles, destFile) ->
|
|
|
|
g.src srcFiles
|
|
|
|
.pipe g.p.plumber()
|
|
|
|
.pipe g.p.if g.config.sourceMaps, g.p.sourcemaps.init()
|
|
|
|
.pipe g.p.sass()
|
|
|
|
.pipe g.p.concat destFile
|
|
|
|
.pipe g.p.if g.config.sourceMaps, g.p.sourcemaps.write('.')
|
|
|
|
.pipe g.dest 'source/assets/css'
|
2016-02-04 08:23:26 +00:00
|
|
|
.pipe g.p.if g.config.liveReload, g.p.livereload()
|
2016-02-03 19:24:47 +00:00
|
|
|
|
|
|
|
g.js = (srcFiles, destFile) ->
|
|
|
|
g.src srcFiles
|
|
|
|
.pipe g.p.plumber()
|
|
|
|
.pipe g.p.if g.config.sourceMaps, g.p.sourcemaps.init()
|
|
|
|
.pipe g.p.concat destFile
|
|
|
|
.pipe g.p.if g.config.production, g.p.uglify()
|
|
|
|
.pipe g.p.if g.config.sourceMaps, g.p.sourcemaps.write('.')
|
|
|
|
.pipe g.dest 'source/assets/js'
|
2016-02-02 22:01:32 +00:00
|
|
|
|
|
|
|
require('fs').readdirSync('./gulp').forEach (task) -> require "./gulp/#{task}"
|