0.0.9 • Published 8 years ago

hotglue v0.0.9

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

hotglue

Mount a certain kind of Koa + Browserify app for hot reloading convenience in development and minified/gzipped/fingerprinted/cached convenience in production. Kind of like the asset pipeline and code reloading bits of Rails.

NOTE: Hot reloading code in Node/JS is super hacky, so don't be afraid to refresh your page or restart your server if something is off.

Example

Wrap a Koa app by specifying the main entry points of the server and client, along with which files to watch on the server and client for reloading.

const hotglue = require('hotglue')

const app = module.exports = hotglue({
  relative: __dirname,
  server: {
    main: 'server.js',
    watch: ['server.js']
  },
  client: {
    main: 'client.js',
    watch: ['client.js']
  }
})

if (require.main === module) {
  app.listen(3000)
  console.log('Listening')
}

With this you get...

...in development...

  • Websocket hot reloaded server and client-side code

...in production (TBD)...

  • Minified + gzipped + fingerprinted + cached JS bundles served by Koa
  • Duplicate dependencies b/t bundles extracted into an optimized common bundle
  • Bundling occuring in the background while serving un-optimized bundles in the meantime
0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago