Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kamahl19/hapi-webpack-plugin-2
Webpack middleware for Hapi. Supports HMR.
https://github.com/kamahl19/hapi-webpack-plugin-2
Last synced: 9 days ago
JSON representation
Webpack middleware for Hapi. Supports HMR.
- Host: GitHub
- URL: https://github.com/kamahl19/hapi-webpack-plugin-2
- Owner: Kamahl19
- License: mit
- Created: 2019-06-13T10:25:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-27T03:42:32.000Z (over 1 year ago)
- Last Synced: 2024-11-06T00:51:43.857Z (9 days ago)
- Language: TypeScript
- Size: 217 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hapi Webpack Plugin 2
[Webpack](http://webpack.github.io) middleware for [Hapi](https://github.com/hapijs/hapi). Supports HMR.
## Prerequisites
These packages are a peer dependency for this plugin.
- Hapi (tested on >= 17.0)
- webpack (tested on >= 4.0)## Installation
```
npm i -D hapi-webpack-plugin-2
```## Usage
You can use this plugin in two ways.
### 1) With `config` object
```js
const webpack = require('webpack');
const HapiWebpackPlugin = require('hapi-webpack-plugin-2');server.register({
plugin: HapiWebpackPlugin,
options: {
config: {
compiler: webpack({
// webpack options http://webpack.github.io
}),
assets: {
// webpack-dev-middleware options https://github.com/webpack/webpack-dev-middleware
},
hot: {
// webpack-hot-middleware options https://github.com/glenjamin/webpack-hot-middleware
},
},
},
});
```### 2) With `configPath`
```js
const HapiWebpackPlugin = require('hapi-webpack-plugin-2');server.register({
plugin: HapiWebpackPlugin,
options: {
configPath: './webpack.config.js',
},
});
```## Acknowledgement
This plugin is originally based on [hapi-webpack-plugin](https://github.com/SimonDegraeve/hapi-webpack-plugin)
which was in need of upgrading but seems to be abandoned. Among other issues, it is not compatible with Babel 7 and Webpack 4.## License
MIT