This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
oliverdavies.uk-old-sculpin/gulpfile.coffee

37 lines
1.1 KiB
CoffeeScript
Raw Normal View History

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'
.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}"