Skip to content

Commit

Permalink
Merge pull request #10 from vesse/master
Browse files Browse the repository at this point in the history
Update all deps (including Browserify)
  • Loading branch information
rikukissa committed Oct 24, 2014
2 parents e928666 + 70cee19 commit c6c9bd5
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 35 deletions.
47 changes: 30 additions & 17 deletions gulpfile.coffee
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
path = require 'path'
browserify = require 'browserify'
chalk = require 'chalk'
CSSmin = require 'gulp-minify-css'
ecstatic = require 'ecstatic'
gulp = require 'gulp'
gutil = require 'gulp-util'
jade = require 'gulp-jade'
stylus = require 'gulp-stylus'
CSSmin = require 'gulp-minify-css'
browserify = require 'browserify'
watchify = require 'watchify'
livereload = require 'gulp-livereload'
path = require 'path'
prefix = require 'gulp-autoprefixer'
prettyTime = require 'pretty-hrtime'
source = require 'vinyl-source-stream'
streamify = require 'gulp-streamify'
stylus = require 'gulp-stylus'
uglify = require 'gulp-uglify'
ecstatic = require 'ecstatic'
livereload = require 'gulp-livereload'
prefix = require 'gulp-autoprefixer'
watchify = require 'watchify'

production = process.env.NODE_ENV is 'production'

Expand Down Expand Up @@ -43,8 +45,9 @@ gulp.task 'scripts', ->
bundle = browserify
entries: [paths.scripts.source]
extensions: ['.coffee']
debug: not production

build = bundle.bundle(debug: not production)
build = bundle.bundle()
.on 'error', handleError
.pipe source paths.scripts.filename

Expand All @@ -60,7 +63,7 @@ gulp.task 'templates', ->
.on 'error', handleError
.pipe gulp.dest paths.templates.destination

pipeline = pipeline.pipe livereload() unless production
pipeline = pipeline.pipe livereload(auto: false) unless production

pipeline

Expand All @@ -75,7 +78,7 @@ gulp.task 'styles', ->

styles = styles.pipe(CSSmin()) if production
styles = styles.pipe gulp.dest paths.styles.destination
styles = styles.pipe livereload() unless production
styles = styles.pipe livereload(auto: false) unless production
styles

gulp.task 'assets', ->
Expand All @@ -85,31 +88,41 @@ gulp.task 'assets', ->

gulp.task 'server', ->
require('http')
.createServer ecstatic root: __dirname + '/public'
.createServer ecstatic root: path.join(__dirname, 'public')
.listen 9001

gulp.task "watch", ->
gulp.task 'watch', ->
livereload.listen()

gulp.watch paths.templates.watch, ['templates']
gulp.watch paths.styles.watch, ['styles']
gulp.watch paths.assets.watch, ['assets']

bundle = watchify
bundle = watchify browserify
entries: [paths.scripts.source]
extensions: ['.coffee']
debug: not production
cache: {}
packageCache: {}
fullPaths: true

bundle.on 'update', ->
build = bundle.bundle(debug: not production)
gutil.log "Starting '#{chalk.cyan 'rebundle'}'..."
start = process.hrtime()
build = bundle.bundle()
.on 'error', handleError

.pipe source paths.scripts.filename

build
.pipe gulp.dest paths.scripts.destination
.pipe(livereload())
gutil.log "Finished '#{chalk.cyan 'rebundle'}' after #{chalk.magenta prettyTime process.hrtime start}"

.emit 'update'

gulp.task "build", ['scripts', 'templates', 'styles', 'assets']
gulp.task "default", ["build", "watch", "server"]
gulp.task 'no-js', ['templates', 'styles', 'assets']
gulp.task 'build', ['scripts', 'no-js']
# scripts and watch conflict and will produce invalid js upon first run
# which is why the no-js task exists.
gulp.task 'default', ['watch', 'no-js', 'server']
39 changes: 21 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,34 @@
"template"
],
"dependencies": {
"coffee-script": "~1.7.1"
"coffee-script": "~1.8.0"
},
"devDependencies": {
"gulp-uglify": "~0.1.0",
"gulp-util": "~2.2.17",
"gulp-stylus": "1.3.3",
"gulp-jade": "~0.6.0",
"gulp-livereload": "~2.1.0",
"bower": "~1.3.5",
"gulp-autoprefixer": "0.0.7",
"browserify": "~4.1.11",
"gulp-streamify": "0.0.5",
"vinyl-source-stream": "~0.1.1",
"browserify": "~6.1.0",
"browserify-shim": "~3.8.0",
"chalk": "~0.5.1",
"coffeeify": "~0.7.0",
"deamdify": "^0.1.1",
"debowerify": "~0.9.1",
"ecstatic": "~0.5.3",
"gulp": "~3.8.1",
"gulp-autoprefixer": "1.0.1",
"gulp-jade": "~0.9.0",
"gulp-livereload": "~2.1.0",
"gulp-minify-css": "~0.3.5",
"gulp-streamify": "0.0.5",
"gulp-stylus": "1.3.3",
"gulp-uglify": "~1.0.1",
"gulp-util": "~3.0.1",
"karma": "~0.12.21",
"karma-jasmine": "~0.1.5",
"karma-chrome-launcher": "~0.1.4",
"karma-cli": "0.0.4",
"karma-coffee-preprocessor": "~0.2.1",
"gulp": "~3.8.1",
"watchify": "~0.10.2",
"ecstatic": "~0.5.3",
"gulp-minify-css": "~0.3.5",
"deamdify": "^0.1.1",
"debowerify": "~0.8.2",
"browserify-shim": "~3.8.0"
"karma-jasmine": "~0.2.2",
"pretty-hrtime": "~0.2.2",
"vinyl-source-stream": "~1.0.0",
"watchify": "~2.0.0"
},
"browser": {},
"browserify-shim": {},
Expand Down

0 comments on commit c6c9bd5

Please sign in to comment.