Last active
August 29, 2015 14:08
-
-
Save josephj/d4edf708bbea2c95f168 to your computer and use it in GitHub Desktop.
Development tools for developer portal project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################ | |
# Dependencies | |
################ | |
gulp = require 'gulp' | |
watch = require 'gulp-watch' | |
connect = require 'gulp-connect' | |
open = require 'gulp-open' | |
path = require 'path' | |
exec = require('child_process').exec | |
################ | |
# Constants | |
################ | |
WEB_HOST = 'localhost' | |
WEB_PORT = 6002 | |
WEB_ROOT = 'app/public/' | |
LIVERELOAD_PORT = 35719 | |
gulp.task 'connect', -> | |
connect.server | |
host: WEB_HOST | |
port: WEB_PORT | |
root: WEB_ROOT | |
livereload: | |
port: LIVERELOAD_PORT | |
gulp.task 'build', -> | |
exec "cd #{WEB_ROOT}; phr up" | |
gulp.task 'open', -> | |
gulp.src "#{WEB_ROOT}index.html" | |
.pipe open('', url: "http://#{WEB_HOST}:#{WEB_PORT}") | |
gulp.task 'watch', -> | |
watch "#{WEB_ROOT}.phrozn/**/*.twig", (vinyl) -> | |
file = path.basename(vinyl.history) | |
cmd = "cd #{WEB_ROOT}; phr single #{file} .phrozn" | |
console.log "Executing '#{cmd}'" | |
exec cmd | |
watch "#{WEB_ROOT}**/*.html", -> | |
gulp.src "#{WEB_ROOT}**/*.html" | |
.pipe connect.reload() | |
gulp.task('default', ['build', 'connect', 'open', 'watch']); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('coffee-script/register'); | |
require('./gulpfile.coffee'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"devDependencies": { | |
"coffee-script": "^1.8.0", | |
"gulp": "^3.8.10", | |
"gulp-connect": "^2.2.0", | |
"gulp-open": "^0.3.2", | |
"gulp-watch": "^4.2.4" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment