Skip to content

Instantly share code, notes, and snippets.

@josephj
Created November 16, 2014 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephj/f220238602ae0201efc7 to your computer and use it in GitHub Desktop.
Save josephj/f220238602ae0201efc7 to your computer and use it in GitHub Desktop.
# Constants
CSS_PATH = './src/assets/css/*.css'
JS_PATH = './src/assets/js/*.js'
SASS_PATH = './src/assets/css/*.sass'
OUTPUT_PATH = './src/assets/css'
HTML_PATH = './src/index.html'
HTTP_PORT = 8087
LIVERELOAD_PORT = 32718
# Gulp plugins
gulp = require 'gulp'
connect = require 'gulp-connect'
sass = require 'gulp-sass'
watch = require 'gulp-watch'
# Task - connect
gulp.task 'connect', ->
connect.server
root: ['src']
port: HTTP_PORT
livereload:
port: LIVERELOAD_PORT
# Task - watch
gulp.task 'watch', ->
gulp.src SASS_PATH
.pipe watch(SASS_PATH)
.pipe sass
errLogToConsole: true
sourceComments : 'normal'
.pipe gulp.dest(OUTPUT_PATH)
gulp.src [HTML_PATH, CSS_PATH, JS_PATH]
.pipe watch([HTML_PATH, CSS_PATH, JS_PATH])
.pipe connect.reload()
gulp.task 'default', ['connect', 'watch']
require('coffee-script/register');
require('./gulpfile.coffee');
{
"name": "prototype",
"version": "0.0.0",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "josephj",
"license": "ISC",
"devDependencies": {
"coffee-script": "^1.8.0",
"gulp": "^3.8.10",
"gulp-connect": "^2.2.0",
"gulp-sass": "^1.1.0",
"gulp-watch": "^1.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment