vite-plugin-rebundle 1.2.5 → 1.2.6

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/rebundle.js CHANGED
@@ -140,7 +140,7 @@ export class Rebundle extends $utils.Unit {
140
140
  await this.removeDirectoryIfEmpty(dir);
141
141
  }
142
142
  // Notify about changed chunks
143
- if (changedChunkNames.length > 0) {
143
+ if (ws && changedChunkNames.length > 0) {
144
144
  ws.clients.forEach(client => client.send(JSON.stringify(changedChunkNames)));
145
145
  }
146
146
  };
@@ -166,6 +166,10 @@ export class Rebundle extends $utils.Unit {
166
166
  return this.ws;
167
167
  if (!this.port)
168
168
  throw this.never;
169
+ if (!this.config)
170
+ throw this.never;
171
+ if (!this.config.build.watch)
172
+ return null;
169
173
  this.ws = new $ws.WebSocketServer({ port: this.port });
170
174
  return this.ws;
171
175
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-rebundle",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "imkost",
package/readme.md CHANGED
@@ -6,8 +6,6 @@ A Vite plugin that guarantees **one standalone file per entry point**. Each entr
6
6
 
7
7
  Sometimes you need bundles without dynamic imports. Vite/Rollup don’t provide this option when building with multiple entries. This plugin solves it by rebundling Vite’s output with esbuild to enforce single-file output.
8
8
 
9
- > ℹ️ Useful when targeting environments that require standalone files (e.g., browser extensions, legacy systems, or file-based distribution).
10
-
11
9
  > ⚠️ This plugin runs **only during** `vite build`. It does not affect the Vite dev server.
12
10
 
13
11
  ## Installation
@@ -38,7 +36,7 @@ export default defineConfig({
38
36
  })
39
37
  ```
40
38
 
41
- ### Options
39
+ ## Options
42
40
 
43
41
  You can provide **esbuild options per entry point**. This is useful, for example, to inject custom define variables into specific bundles:
44
42