@depup/cloudflare__vite-plugin 1.61.0-depup.1 → 1.62.0-depup.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/README.md CHANGED
@@ -13,7 +13,7 @@ npm install @depup/cloudflare__vite-plugin
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [@cloudflare/vite-plugin](https://www.npmjs.com/package/@cloudflare/vite-plugin) @ 1.61.0 |
16
+ | Original | [@cloudflare/vite-plugin](https://www.npmjs.com/package/@cloudflare/vite-plugin) @ 1.62.0 |
17
17
  | Processed | 2026-09-28 |
18
18
  | Smoke test | failed |
19
19
  | Deps updated | 2 |
package/changes.json CHANGED
@@ -9,6 +9,6 @@
9
9
  "to": "^8.22.0"
10
10
  }
11
11
  },
12
- "timestamp": "2026-09-28T08:18:21.116Z",
12
+ "timestamp": "2026-09-28T16:10:22.836Z",
13
13
  "totalUpdated": 2
14
14
  }
package/dist/index.mjs CHANGED
@@ -65811,7 +65811,7 @@ function resolveWorker(workerConfig, devOnly, parsedNewWorkerConfig) {
65811
65811
  }
65812
65812
  const NEW_CONFIG_FILENAME = "cloudflare.config.ts";
65813
65813
  const TYPES_OUTPUT_PATH = ".cloudflare/types/index.d.ts";
65814
- const EXPERIMENTAL_CONFIG_PKG = "@cloudflare/vite-plugin/experimental-config";
65814
+ const CONFIG_PACKAGE = "cf/config";
65815
65815
  /**
65816
65816
  * Load and convert a `cloudflare.config.ts` file via `@cloudflare/config`. Returns
65817
65817
  * the resulting Wrangler `RawConfig`, the parsed new-config shape (for
@@ -65849,9 +65849,8 @@ async function loadNewConfig(options) {
65849
65849
  }
65850
65850
  /**
65851
65851
  * Write `.cloudflare/types/index.d.ts` using
65852
- * `@cloudflare/config`'s `generateTypes`, targeting the vite-plugin's
65853
- * `experimental-config` subpath (so users don't need a direct dependency on
65854
- * `@cloudflare/config`).
65852
+ * `@cloudflare/config`'s `generateTypes`, targeting the public `cf/config`
65853
+ * package used by `cloudflare.config.ts`.
65855
65854
  *
65856
65855
  * When `includeRuntime` is true, appends the Workers runtime types (generated
65857
65856
  * from the project's compatibility date/flags) after the inference block. The
@@ -65873,7 +65872,7 @@ async function writeCloudflareTypes(options) {
65873
65872
  } catch {}
65874
65873
  let content = generateTypes({
65875
65874
  configPath: configImportPath,
65876
- packageName: EXPERIMENTAL_CONFIG_PKG
65875
+ packageName: CONFIG_PACKAGE
65877
65876
  });
65878
65877
  if (options.includeRuntime) {
65879
65878
  const { runtimeHeader, runtimeTypes } = await generateRuntimeTypes({
@@ -80300,43 +80299,43 @@ function createContainerCleanup() {
80300
80299
  }
80301
80300
  };
80302
80301
  }
80302
+ const containerCleanupKey = Symbol("vite-plugin-cloudflare:container-cleanup");
80303
80303
  /**
80304
- * Retains Container cleanup across config reloads using Vite's inline plugins.
80305
- * The state belongs to this server, not the re-evaluated cloudflare() factory.
80304
+ * Retains Container cleanup across config reloads for one server session.
80306
80305
  */
80307
80306
  function getDevContainerCleanup(server) {
80308
- const pluginName = "vite-plugin-cloudflare:container-cleanup";
80309
- const retainedPlugin = server.config.plugins.find((plugin$1) => plugin$1.name === pluginName);
80310
- if (retainedPlugin?.api) return retainedPlugin.api;
80311
- const cleanup = createContainerCleanup();
80312
- const plugin = {
80313
- name: pluginName,
80314
- api: cleanup,
80315
- configureServer(nextServer) {
80316
- attachContainerCleanup(nextServer, cleanup);
80317
- }
80318
- };
80319
- server.config = {
80320
- ...server.config,
80321
- inlineConfig: {
80307
+ let cleanup = server.config.inlineConfig[containerCleanupKey];
80308
+ if (!cleanup) {
80309
+ cleanup = createContainerCleanup();
80310
+ const inlineConfig = {
80322
80311
  ...server.config.inlineConfig,
80323
- plugins: [...server.config.inlineConfig.plugins ?? [], plugin]
80324
- }
80325
- };
80312
+ [containerCleanupKey]: cleanup
80313
+ };
80314
+ server.config = {
80315
+ ...server.config,
80316
+ inlineConfig
80317
+ };
80318
+ }
80326
80319
  attachContainerCleanup(server, cleanup);
80327
80320
  return cleanup;
80328
80321
  }
80329
80322
  function attachContainerCleanup(server, cleanup) {
80323
+ if (server.close[containerCleanupKey] === cleanup) return;
80330
80324
  const restartServer = server.restart.bind(server);
80331
- server.restart = (...args) => cleanup.restart(() => restartServer(...args));
80325
+ server.restart = (...args) => cleanup.restart(async () => {
80326
+ await restartServer(...args);
80327
+ if (!server.config.plugins.some((plugin) => plugin.name === "vite-plugin-cloudflare:dev")) attachContainerCleanup(server, cleanup);
80328
+ });
80332
80329
  const closeServer = server.close.bind(server);
80333
- server.close = async () => {
80330
+ const closeWithCleanup = async () => {
80334
80331
  try {
80335
80332
  await closeServer();
80336
80333
  } finally {
80337
80334
  if (!cleanup.isRestarting) cleanup.cleanup();
80338
80335
  }
80339
80336
  };
80337
+ closeWithCleanup[containerCleanupKey] = cleanup;
80338
+ server.close = closeWithCleanup;
80340
80339
  }
80341
80340
 
80342
80341
  //#endregion