@cloudflare/vite-plugin 1.11.3 → 1.11.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.
Files changed (2) hide show
  1. package/dist/index.js +24 -0
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -705,6 +705,29 @@ function resolveDockerHost(dockerPath) {
705
705
  }
706
706
  return process.platform === "win32" ? "//./pipe/docker_engine" : "unix:///var/run/docker.sock";
707
707
  }
708
+ async function getImageRepoTags(dockerPath, imageTag) {
709
+ try {
710
+ const output = await dockerImageInspect(dockerPath, {
711
+ imageTag,
712
+ formatString: "{{ range .RepoTags }}{{ . }}\n{{ end }}"
713
+ });
714
+ return output.split("\n").filter((tag) => tag.trim() !== "");
715
+ } catch {
716
+ return [];
717
+ }
718
+ }
719
+ async function cleanupDuplicateImageTags(dockerPath, imageTag) {
720
+ try {
721
+ const repoTags = await getImageRepoTags(dockerPath, imageTag);
722
+ const tagsToRemove = repoTags.filter(
723
+ (tag) => tag !== imageTag && tag.startsWith("cloudflare-dev")
724
+ );
725
+ if (tagsToRemove.length > 0) {
726
+ runDockerCmdWithOutput(dockerPath, ["rmi", ...tagsToRemove]);
727
+ }
728
+ } catch {
729
+ }
730
+ }
708
731
 
709
732
  // ../workers-shared/asset-worker/src/utils/rules-engine.ts
710
733
  var ESCAPE_REGEX_CHARACTERS = /[-/\\^$*+?.()|[\]{}]/g;
@@ -14615,6 +14638,7 @@ To use an existing image from another repository, see https://developers.cloudfl
14615
14638
  });
14616
14639
  }
14617
14640
  if (!aborted) {
14641
+ await cleanupDuplicateImageTags(dockerPath, options.image_tag);
14618
14642
  await checkExposedPorts(dockerPath, options);
14619
14643
  }
14620
14644
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudflare/vite-plugin",
3
- "version": "1.11.3",
3
+ "version": "1.11.5",
4
4
  "description": "Cloudflare plugin for Vite",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -41,11 +41,11 @@
41
41
  "unenv": "2.0.0-rc.19",
42
42
  "ws": "8.18.0",
43
43
  "@cloudflare/unenv-preset": "2.6.1",
44
- "miniflare": "4.20250803.1",
45
- "wrangler": "4.29.0"
44
+ "wrangler": "4.30.0",
45
+ "miniflare": "4.20250813.1"
46
46
  },
47
47
  "devDependencies": {
48
- "@cloudflare/workers-types": "^4.20250803.0",
48
+ "@cloudflare/workers-types": "^4.20250813.0",
49
49
  "@types/node": "^22.10.1",
50
50
  "@types/ws": "^8.5.13",
51
51
  "magic-string": "^0.30.12",
@@ -55,13 +55,13 @@
55
55
  "vite": "7.0.0",
56
56
  "vitest": "~3.2.0",
57
57
  "@cloudflare/mock-npm-registry": "0.0.0",
58
+ "@cloudflare/containers-shared": "0.2.10",
58
59
  "@cloudflare/workers-shared": "0.18.5",
59
- "@cloudflare/workers-tsconfig": "0.0.0",
60
- "@cloudflare/containers-shared": "0.2.9"
60
+ "@cloudflare/workers-tsconfig": "0.0.0"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "vite": "^6.1.0 || ^7.0.0",
64
- "wrangler": "^4.29.0"
64
+ "wrangler": "^4.30.0"
65
65
  },
66
66
  "publishConfig": {
67
67
  "access": "public"