Skip to content

yoshuawuyts/koa-watchify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

koa-watchify

NPM version build status Downloads

Wraps a browserify or watchify instance into a koa middleware.

Installation

$ npm install koa-watchify

Usage

const wreq     = require('koa-watchify')
const watchify = require('watchify')
const path     = require('path')
const koa      = require('koa')
const app      = koa()

var bundle = browserify({
  entries: [path.join(process.cwd(), 'index.js')],
  fullPaths: true,
  packageCache: {},
  cache: {}
})

if ('development' == process.env.NODE_ENV) bundle = watchify(bundle)

app.use(wreq(bundle))
app.listen(process.env.port || 1337)

Why?

Setting up boilerplate for browserify / watchify can be a bit annoying. This module provides a good entry point for both development and production servers running koa and browserify. No gulp, grunt or make needed.

Contributors

See Also

License

MIT

About

Wraps a browserify or watchify instance into a koa middleware

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published