Webpack middleware for Hapi. Supports HMR.
These packages are a peer dependency for this plugin.
- Hapi (tested on >= 17.0)
- webpack (tested on >= 4.0)
npm i -D hapi-webpack-plugin-2
You can use this plugin in two ways.
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
},
},
},
});
const HapiWebpackPlugin = require('hapi-webpack-plugin-2');
server.register({
plugin: HapiWebpackPlugin,
options: {
configPath: './webpack.config.js',
},
});
This plugin is originally based on 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.
MIT