New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hot-reload-extension-vite

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hot-reload-extension-vite - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

22

dist/scripts/background-reload.js

@@ -9,11 +9,15 @@ "use strict";

if (isDev) {
const socket = new WebSocket(
`ws://localhost:${HOT_RELOAD_EXTENSION_VITE_PORT}`
);
socket.addEventListener("message", (event) => {
if (event.data === "file-change" /* FILE_CHANGE */) {
chrome.runtime.reload();
chrome.tabs.reload();
}
});
try {
const socket = new WebSocket(
`ws://localhost:${HOT_RELOAD_EXTENSION_VITE_PORT}`
);
socket.addEventListener("message", (event) => {
if (event.data === "file-change" /* FILE_CHANGE */) {
chrome.runtime.reload();
chrome.tabs.reload();
}
});
} catch (e) {
console.info("Please run `npm run dev` to start socket.", e);
}
}
{
"name": "hot-reload-extension-vite",
"version": "1.0.4",
"version": "1.0.5",
"description": "Simple vite plugin to reload the chrome extension.",

@@ -5,0 +5,0 @@ "main": "dist/main.js",

@@ -5,5 +5,5 @@ # Hot Reload Chrome Extension - Vite Plugin

Inspired by [stackoverflow answer](https://stackoverflow.com/a/65485938/7135342) and other similar repo.
Inspired by [stackoverflow answer](https://stackoverflow.com/a/65485938/7135342) and other similar repos.
![demo](https://raw.githubusercontent.com/isaurssaurav/hot-reload-extension-vite/main/demo/demo.png)
![image](https://raw.githubusercontent.com/isaurssaurav/hot-reload-extension-vite/main/image.png)

@@ -36,3 +36,3 @@ ## Usage

```bash
$ NODE_ENV=development vite build --watch
$ NODE_ENV=development vite build --watch // Override NODE_ENV
```

@@ -42,6 +42,2 @@

## Running example
In progress
## Options

@@ -52,6 +48,12 @@

| log | boolean (optional) | Logs error and info. |
| backgroundPath | string(required) | Path to background service worker file. |
| backgroundPath | string (required) | Path to background service worker file. |
## Env variables
| Variable | default | Description |
| ------------------------------ | ------- | --------------- |
| HOT_RELOAD_EXTENSION_VITE_PORT | 8080 | Web socket port |
## License
MIT

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc