Name: hapi-nuxt
Owner: Nuxt Community
Description: Nuxt plugin for Hapi.js
Created: 2017-02-05 08:52:34.0
Updated: 2018-05-20 17:05:50.0
Pushed: 2017-12-20 09:49:15.0
Size: 142
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
IMPORTANT: Starting from 1.x versions, this plugin is only compatible with Hapi >= 17
Install plugin:
add hapi-nuxt # or npm install hapi-nuxt
Register it on your server:
t Hapi = require('hapi')
t HapiNuxt = require('hapi-nuxt')
..
er = new Hapi.Server()
t server.register(HapiNuxt)
By default this plugin tries to read nuxt.config.js
from current directory and pass it as options.
You can either provide a new path by setting options to an string value or directly passing options
t server.register({
plugin: HapiNuxt
options: {
// Nuxt options
}
If nuxt.options.dev
(Automatically set by nuxt if not provided in options) is true
plugin automatically starts a Builder
allow to hot reload on dev. You can manually disable this behavior by using options.startOnly
to true
.
nuxt
and builder
instancesPlugin exposes nuxt and builder (for dev only) instances to hapi.
er = new Hapi.Server()
t server.register(HapiNuxt)
ccess to nuxt and builder instances using server.plugins.nuxt
t { nuxt, builder } = server.plugins.nuxt
MIT - Fandogh & Nuxt.js