fastify-bankai

0.4.0 • Public • Published

fastify-bankai

js-standard-style Build Status Greenkeeper badge

If you need to compile (browserify style!) your code, this plugin is for you! Internally it uses bankai, so refer to its documentation for the options.

fastify-bankai will automatically live-reload your HTML and regenerate your bundle whenever your code change. This can be disabled in test or in production.

Install

npm i fastify-bankai --save

Usage

Simply require this plugin, pass the entry file and you are done!

const fastify = require('fastify')()
 
fastify.register(require('fastify-bankai'), {
  entry: './client.js'
})
 
fastify.listen(3000, err => {
  if (err) throw err
  console.log('Server listenting on localhost:', fastify.server.address().port)
})

In tests or in production

If you are including fastify-bankai in any test run or in production, you must disable the automatic watch mode:

const fastify = require('fastify')()
 
fastify.register(require('fastify-bankai'), {
  entry: './client.js',
  watch: false
})
 
fastify.listen(3000, err => {
  if (err) throw err
  console.log('Server listenting on localhost:', fastify.server.address().port)
})

Options

  • entry: Your application entry point
  • prefix: prefix all paths served by fastify-bankai with the given path

The option object is passed directly to bankai.

Acknowledgements

This project is kindly sponsored by:

License

Licensed under MIT.

Dependencies (2)

Dev Dependencies (4)

Package Sidebar

Install

npm i fastify-bankai

Weekly Downloads

1

Version

0.4.0

License

MIT

Last publish

Collaborators

  • gurgunday
  • metcoder95
  • galvez
  • simenb
  • coopflow
  • simoneb
  • rafaelgss
  • starptech
  • delvedor
  • matteo.collina
  • allevo
  • jsumners
  • zekth
  • eomm
  • fox1t
  • airhorns
  • kibertoad
  • climba03003