@nishantvij/vite-plugin-hmr-gate 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/index.ts
17
+ var index_exports = {};
18
+ module.exports = __toCommonJS(index_exports);
@@ -0,0 +1,14 @@
1
+ import { Plugin } from 'vite';
2
+
3
+ interface HmrGateOptions {
4
+ /** Use full-reload (true, default) vs granular per-module HMR (false). */
5
+ fullReload?: boolean;
6
+ /** Watcher events to intercept. Default: all three — a freeze must catch adds and
7
+ * deletes, not just content changes (e.g. atomic writes / synced files surface as add/unlink). */
8
+ events?: ("change" | "add" | "unlink")[];
9
+ /** File path substrings that bypass the gate (always emitted immediately). */
10
+ passthrough?: string[];
11
+ }
12
+ declare function hmrGatePlugin(options?: HmrGateOptions): Plugin;
13
+
14
+ export { type HmrGateOptions, hmrGatePlugin };
@@ -0,0 +1,14 @@
1
+ import { Plugin } from 'vite';
2
+
3
+ interface HmrGateOptions {
4
+ /** Use full-reload (true, default) vs granular per-module HMR (false). */
5
+ fullReload?: boolean;
6
+ /** Watcher events to intercept. Default: all three — a freeze must catch adds and
7
+ * deletes, not just content changes (e.g. atomic writes / synced files surface as add/unlink). */
8
+ events?: ("change" | "add" | "unlink")[];
9
+ /** File path substrings that bypass the gate (always emitted immediately). */
10
+ passthrough?: string[];
11
+ }
12
+ declare function hmrGatePlugin(options?: HmrGateOptions): Plugin;
13
+
14
+ export { type HmrGateOptions, hmrGatePlugin };
package/dist/index.js ADDED
File without changes
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@nishantvij/vite-plugin-hmr-gate",
3
+ "version": "1.1.0",
4
+ "description": "Vite plugin that gates HMR updates behind an HTTP flush signal",
5
+ "main": "./dist/index.cjs",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "type": "module",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsup src/index.ts --format cjs,esm --dts --outDir dist",
14
+ "typecheck": "tsgo --noEmit",
15
+ "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
16
+ "test": "vitest",
17
+ "prepublishOnly": "npm run clean && npm run build",
18
+ "clean": "rimraf dist"
19
+ },
20
+ "keywords": [
21
+ "vite",
22
+ "plugin",
23
+ "hmr",
24
+ "hot-module-replacement"
25
+ ],
26
+ "license": "MIT",
27
+ "peerDependencies": {
28
+ "vite": ">=5.0.0 <9.0.0"
29
+ },
30
+ "peerDependenciesMeta": {
31
+ "vite": {
32
+ "optional": false
33
+ }
34
+ },
35
+ "devDependencies": {
36
+ "@types/node": "catalog:",
37
+ "rimraf": "^5.0.0",
38
+ "tsup": "^7.2.0",
39
+ "typescript": "catalog:",
40
+ "vitest": "catalog:"
41
+ },
42
+ "directories": {
43
+ "test": "tests"
44
+ }
45
+ }