webpack-hmr-server
Advanced tools
Comparing version 1.1.5 to 1.1.6
{ | ||
"name": "webpack-hmr-server", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "Webpack hot reloading using http server and websocket", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -9,3 +9,3 @@ # webpack-hmr-server | ||
![test](https://img.shields.io/badge/ReactJS-success-green) | ||
![test](https://img.shields.io/badge/VueJS-wait-red) | ||
![test](https://img.shields.io/badge/VueJS-todo-red) | ||
![test](https://img.shields.io/badge/VanillaJS-done-green) | ||
@@ -67,2 +67,16 @@ | ||
## Example usage for create custom overlay | ||
```ts | ||
import type { Types } from 'webpack-hmr-server'; | ||
document.addEventListener("__webpack_hmr_sever__", (e) => { | ||
const { detail } = e as unknown as { detail: unknown }; | ||
const event = detail as Types.Event; | ||
// custom logic for overlay | ||
}) | ||
``` | ||
- - - | ||
@@ -92,3 +106,3 @@ | ||
if module.hot.check(true) is called in a running application, then a request for JSON will be sent. If successful, modules will be updated | ||
if ```module.hot.check(true)``` is called in a running application, then a request for JSON will be sent. If successful, modules will be updated | ||
@@ -95,0 +109,0 @@ - - - |
37493
131