https://github.com/prashaantt/hapi-webpack-dev-middleware
Use webpack-dev-middleware in hapi
https://github.com/prashaantt/hapi-webpack-dev-middleware
hapi webpack-dev-middleware
Last synced: 5 months ago
JSON representation
Use webpack-dev-middleware in hapi
- Host: GitHub
- URL: https://github.com/prashaantt/hapi-webpack-dev-middleware
- Owner: prashaantt
- License: mit
- Created: 2016-01-19T12:19:03.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-13T12:20:32.000Z (about 9 years ago)
- Last Synced: 2024-08-09T08:07:26.240Z (over 1 year ago)
- Topics: hapi, webpack-dev-middleware
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 8
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hapi-webpack-dev-middleware
hapi plugin to use webpack-dev-middleware, possibly in conjunction with [hapi-webpack-hot-middleware](https://github.com/prashaantt/hapi-webpack-hot-middleware).
[](https://david-dm.org/prashaantt/hapi-webpack-dev-middleware)
[](https://david-dm.org/prashaantt/hapi-webpack-dev-middleware#info=devDependencies)
## Breaking change in 2.0
Upgraded to use Webpack 2.
## Installation
```bash
$ npm install hapi-webpack-dev-middleware --save-dev
```
## Usage
Require and register normally as a hapi plugin:
```js
server.register(
{
register: require('hapi-webpack-dev-middleware'),
options: {
config: require('./webpack.config.js'),
options: {
noInfo: true,
publicPath: '/static'
}
}
}
);
```
Configuration options:
- ```config```: The Webpack config to use.
- ```options```: The options you'd normally pass to ```webpack-dev-middleware```. Refer to their [documentation](https://github.com/webpack/webpack-dev-middleware) for all possible values.
**Note: This plugin adds the ```webpackCompiler``` object to the ```server.app``` namespace to share it with any other plugins such as [hapi-webpack-hot-middleware](https://github.com/prashaantt/hapi-webpack-hot-middleware) that depend on the same compiler being available to them.**
## License
MIT