rspack-plugin-cloudflare 0.5.4 → 0.5.5
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.js +1 -10
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { convertConfigToBindings, getNodeCompat, normalizeAndValidateConfig, pri
|
|
|
10
10
|
import { defineEnv } from "unenv";
|
|
11
11
|
import { convertToWranglerConfig, loadAndParseConfig } from "@cloudflare/config";
|
|
12
12
|
import { WebSocketServer } from "ws";
|
|
13
|
-
import {
|
|
13
|
+
import { createContainerDevPlan, generateContainerBuildId, prepareContainerImagesForDev, resolveDockerHost } from "@cloudflare/containers-shared";
|
|
14
14
|
import { Readable } from "node:stream";
|
|
15
15
|
import net from "node:net";
|
|
16
16
|
import { spawn } from "node:child_process";
|
|
@@ -2654,10 +2654,6 @@ async function prepareContainerImages(options) {
|
|
|
2654
2654
|
registryConfigureCommand: "wrangler containers registries configure"
|
|
2655
2655
|
});
|
|
2656
2656
|
}
|
|
2657
|
-
/** Force-removes containers started from these images; synchronous so it can also run while the process exits. */
|
|
2658
|
-
function removeContainers(dockerPath, tags) {
|
|
2659
|
-
if (tags.size > 0) cleanupContainers(dockerPath, tags);
|
|
2660
|
-
}
|
|
2661
2657
|
// src/dev-entry.ts
|
|
2662
2658
|
const RUNTIME_PATH = fileURLToPath(new URL("../runtime/dev-runtime.js", import.meta.url));
|
|
2663
2659
|
const HMR_RUNNER_CLASS = "__RSPACK_HMR_RUNNER__";
|
|
@@ -3100,7 +3096,6 @@ var DevSession = class DevSession {
|
|
|
3100
3096
|
#configWatchers = /* @__PURE__ */ new Map();
|
|
3101
3097
|
#pendingReloads = /* @__PURE__ */ new Map();
|
|
3102
3098
|
#containerTags = /* @__PURE__ */ new Set();
|
|
3103
|
-
#removeContainersOnExit = () => removeContainers(getDockerPath(), this.#containerTags);
|
|
3104
3099
|
#updated = /* @__PURE__ */ new Set();
|
|
3105
3100
|
#failing = /* @__PURE__ */ new Set();
|
|
3106
3101
|
#loading = Promise.resolve();
|
|
@@ -3254,8 +3249,6 @@ var DevSession = class DevSession {
|
|
|
3254
3249
|
});
|
|
3255
3250
|
for (const options of containerOptions) this.#containerTags.add(options.image_tag);
|
|
3256
3251
|
}
|
|
3257
|
-
process.off("exit", this.#removeContainersOnExit);
|
|
3258
|
-
process.on("exit", this.#removeContainersOnExit);
|
|
3259
3252
|
this.#logger.info("Container images built; restart dev to rebuild them after changing a Dockerfile.");
|
|
3260
3253
|
}
|
|
3261
3254
|
return getContainerEngine(first.config, dockerPath);
|
|
@@ -3464,8 +3457,6 @@ var DevSession = class DevSession {
|
|
|
3464
3457
|
await Promise.all(this.#workers.map((worker) => worker.dispose()));
|
|
3465
3458
|
await this.#miniflare?.dispose();
|
|
3466
3459
|
this.#miniflare = void 0;
|
|
3467
|
-
this.#removeContainersOnExit();
|
|
3468
|
-
process.off("exit", this.#removeContainersOnExit);
|
|
3469
3460
|
}
|
|
3470
3461
|
};
|
|
3471
3462
|
// src/tunnel.ts
|