Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
hapi-universal-webpack-plugin
Advanced tools
Hapi plugin that implements dev, hot and hot-server middleware for weback
This plugin integrates webpack-dev-middleware, webpack-hot-middleware and webpack-hot-server-middleware into hapi in order to provide hot-reloading of universal apps (i.e. apps that run on the client and the server).
The following two packages are a peer dependency for this plugin.
$ npm i -D hapi-universal-webpack-plugin
The following steps are required for you to implement the plugin and make it work.
Before you start the server, you want to register the plugin. Provided you have webpack configurations for client and server, the following snippet will get you up and running.
const HapiUniversalWebpackPlugin = require('hapi-universal-webpack-plugin');
const clientConfig = require('path/to/webpack/config');
const serverConfig = require('path/to/webpack/config');
server.register({
plugin: HapiUniversalWebpackPlugin,
options: {
clientConfig,
serverConfig,
},
});
The options
object from the example above accepts the following values:
Key | Type | Default | Required | Description |
---|---|---|---|---|
clientConfig | Object | undefined | yes | webpack configuration for processing the client-side code. |
serverConfig | Object | undefined | no | webpack configuration for processing the server-side code. Without this, the plugin will run in client-only mode, which is fine if you do not need server-side rendering. |
devMiddlewareOptions | Object | {} | no | Options that get passed down to webpack-dev-middleware. See their documentation for further information. |
hotMiddlewareOptions | Object | {} | no | Options that get passed down to webpack-hot-middleware. See their documentation for further information. |
hotServerMiddlewareOptions | Object | {} | no | Options that get passed down to webpack-hot-server-middleware. See their documentation for further information. |
A more detailed documentation on how to setup your webpack
configurations is coming very soon.
In the meantime, just refer to the examples/
directory of this
repository, to see the plugin in action using the example of a universally
rendered VueJS application.
hapi-webpack-plugin is a great solution if you do not need the server-side rendering part this plugin provides. It also served as great inspiration for this implementation.
webpack-hot-server-middleware is the package that provides us with webpack-integration for server-side bundling.
MIT
FAQs
Hapi plugin that implements dev, hot and hot-server middleware for weback
The npm package hapi-universal-webpack-plugin receives a total of 7 weekly downloads. As such, hapi-universal-webpack-plugin popularity was classified as not popular.
We found that hapi-universal-webpack-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.