hot-reload-extension-vite
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -554,3 +554,2 @@ "use strict"; | ||
// src/main.ts | ||
var IS_TRANSFORMED = false; | ||
var hotReloadExtension = (options) => { | ||
@@ -570,7 +569,6 @@ const { log, backgroundPath } = options; | ||
async transform(code, id) { | ||
if (!isDev || IS_TRANSFORMED) { | ||
if (!isDev) { | ||
return; | ||
} | ||
if (id.includes(backgroundPath)) { | ||
IS_TRANSFORMED = true; | ||
const buffer = import_fs.default.readFileSync((0, import_path.resolve)(__dirname, "scripts/background-reload.js")); | ||
@@ -577,0 +575,0 @@ return { |
@@ -9,7 +9,11 @@ "use strict"; | ||
var socket = new WebSocket(`ws://localhost:${HOT_RELOAD_EXTENSION_VITE_PORT}`); | ||
chrome.runtime.onInstalled.addListener((details) => { | ||
if (details.reason === chrome.runtime.OnInstalledReason.UPDATE) { | ||
chrome.tabs.reload(); | ||
} | ||
}); | ||
socket.addEventListener("message", (event) => { | ||
if (event.data === "file-change" /* FILE_CHANGE */) { | ||
chrome.runtime.reload(); | ||
chrome.tabs.reload(); | ||
} | ||
}); |
{ | ||
"name": "hot-reload-extension-vite", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "Simple vite plugin to reload the chrome extension.", | ||
@@ -5,0 +5,0 @@ "main": "dist/main.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41001
1185