@saboya/hapi-webpack-plugin
Webpack middleware for Hapi.
Last updated 6 months ago by saboya .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @saboya/hapi-webpack-plugin 
SYNC missed versions from official npm registry.

Build Status Maintenance Status Dependency Status NPM version

@saboya/hapi-webpack-plugin

Webpack middleware for Hapi. Supports HMR.

This is a fork of Simon Degraeve's hapi-webpack-plugin. This is mostly a rewrite of the plugin using TypeScript and updating it for current versions of Webpack / Hapi, with some added features.

Webpack Version

This was tested with Webpack 4.41. Actual compatibility is unknown.

Hapi version

Tested with Hapi 19. Should be compatible with Hapi >= 17.

Installation

yarn add  @saboya/hapi-webpack-plugin

Usage

See webpack-dev-middleware and webpack-hot-middleware for all available options.

Options for webpack-dev-middleware are set with the dev key in the options object.

Options for webpack-hot-middleware are set with the hot key in the options object.

1) With object as options

import { Server } from '@hapi/hapi';
import { Plugin as HapiWebpackPlugin } from '@saboya/hapi-webpack-plugin';


/**
 * Create server
 */
const server = new Server();

/**
 * Register plugin and start server
 */
async function start() {
  await server.register({
    plugin: HapiWebpackPlugin,
    options: {
      dev: {
        publicPath: '/',
      }, // options for webpack-dev-middleware
      hot: {
        overlay: false,
      }, // options for webpack-hotmiddleware
      webpackConfig: {
        entry: 'src.js'
      },
    },
  })
  
  await server.start();
}

start()

2) With path as options

import { Server } from '@hapi/hapi';
import { Plugin as HapiWebpackPlugin } from '@saboya/hapi-webpack-plugin';


/**
 * Create server
 */
const server = new Server();

/**
 * Register plugin and start server
 */
async function start() {
  await server.register({
    plugin: HapiWebpackPlugin,
    options: {
      webpackConfig: './webpack.config.js'
    }
  })
  
  await server.start();
}

start()

Licence

The MIT License (MIT)

Copyright (c) 2015 Simon Degraeve

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Current Tags

  • 0.0.1                                ...           alpha (7 months ago)
  • 0.0.5                                ...           latest (6 months ago)

5 Versions

  • 0.0.5                                ...           6 months ago
  • 0.0.4                                ...           7 months ago
  • 0.0.3                                ...           7 months ago
  • 0.0.2                                ...           7 months ago
  • 0.0.1                                ...           7 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |