Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fastify/fastify-bankai
Bankai assets compiler for Fastify
https://github.com/fastify/fastify-bankai
assets browserify compiler
Last synced: about 2 months ago
JSON representation
Bankai assets compiler for Fastify
- Host: GitHub
- URL: https://github.com/fastify/fastify-bankai
- Owner: fastify
- License: mit
- Archived: true
- Created: 2017-05-22T10:24:55.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-03-09T14:02:56.000Z (almost 4 years ago)
- Last Synced: 2024-11-06T06:43:26.390Z (2 months ago)
- Topics: assets, browserify, compiler
- Language: JavaScript
- Homepage:
- Size: 31.3 KB
- Stars: 15
- Watchers: 17
- Forks: 7
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-fastify - `fastify-bankai`
README
# fastify-bankai
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) [![Build Status](https://travis-ci.org/fastify/fastify-bankai.svg?branch=master)](https://travis-ci.org/fastify/fastify-bankai) [![Greenkeeper badge](https://badges.greenkeeper.io/fastify/fastify-bankai.svg)](https://greenkeeper.io/)If you need to compile (browserify style!) your code, this plugin is for you!
Internally it uses [bankai](https://github.com/yoshuawuyts/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!
```js
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:```js
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
pathThe option object is passed directly to bankai.
## Acknowledgements
This project is kindly sponsored by:
- [nearForm](http://nearform.com)
- [LetzDoIt](http://www.letzdoitapp.com/)## License
Licensed under [MIT](./LICENSE).