@cloudflare/vite-plugin 1.32.2 → 1.33.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.
@@ -1,7 +1,7 @@
1
1
  //#region package.json
2
2
  var package_default = {
3
3
  name: "@cloudflare/vite-plugin",
4
- version: "1.32.2",
4
+ version: "1.33.0",
5
5
  description: "Cloudflare plugin for Vite",
6
6
  keywords: [
7
7
  "cloudflare",
@@ -62,7 +62,7 @@ var package_default = {
62
62
  "open": "catalog:default",
63
63
  "picocolors": "^1.1.1",
64
64
  "semver": "^7.7.1",
65
- "tinyglobby": "^0.2.12",
65
+ "tinyglobby": "catalog:default",
66
66
  "tree-kill": "catalog:default",
67
67
  "tsdown": "0.16.3",
68
68
  "typescript": "catalog:default",
@@ -79,4 +79,4 @@ var package_default = {
79
79
 
80
80
  //#endregion
81
81
  export { package_default as default };
82
- //# sourceMappingURL=package-Cp1sXVdL.mjs.map
82
+ //# sourceMappingURL=package-C8oIIiCo.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"package-Cp1sXVdL.mjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"@cloudflare/vite-plugin\",\n\t\"version\": \"1.32.2\",\n\t\"description\": \"Cloudflare plugin for Vite\",\n\t\"keywords\": [\n\t\t\"cloudflare\",\n\t\t\"cloudflare-workers\",\n\t\t\"vite\",\n\t\t\"vite-plugin\",\n\t\t\"workers\"\n\t],\n\t\"homepage\": \"https://github.com/cloudflare/workers-sdk/tree/main/packages/vite-plugin-cloudflare#readme\",\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/cloudflare/workers-sdk/issues\"\n\t},\n\t\"license\": \"MIT\",\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"https://github.com/cloudflare/workers-sdk.git\",\n\t\t\"directory\": \"packages/vite-plugin-cloudflare\"\n\t},\n\t\"files\": [\n\t\t\"dist\"\n\t],\n\t\"type\": \"module\",\n\t\"sideEffects\": false,\n\t\"main\": \"./dist/index.mjs\",\n\t\"types\": \"./dist/index.d.mts\",\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"types\": \"./dist/index.d.mts\",\n\t\t\t\"import\": \"./dist/index.mjs\"\n\t\t}\n\t},\n\t\"publishConfig\": {\n\t\t\"access\": \"public\"\n\t},\n\t\"scripts\": {\n\t\t\"build\": \"tsdown\",\n\t\t\"check:type\": \"tsc --build\",\n\t\t\"dev\": \"tsdown --watch\",\n\t\t\"test\": \"vitest run\",\n\t\t\"test:ci\": \"pnpm test\",\n\t\t\"test:e2e\": \"vitest run -c e2e/vitest.config.ts\",\n\t\t\"test:watch\": \"vitest\"\n\t},\n\t\"dependencies\": {\n\t\t\"@cloudflare/unenv-preset\": \"workspace:*\",\n\t\t\"miniflare\": \"workspace:*\",\n\t\t\"unenv\": \"2.0.0-rc.24\",\n\t\t\"wrangler\": \"workspace:*\",\n\t\t\"ws\": \"catalog:default\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@cloudflare/containers-shared\": \"workspace:*\",\n\t\t\"@cloudflare/mock-npm-registry\": \"workspace:*\",\n\t\t\"@cloudflare/workers-shared\": \"workspace:*\",\n\t\t\"@cloudflare/workers-tsconfig\": \"workspace:*\",\n\t\t\"@cloudflare/workers-types\": \"catalog:default\",\n\t\t\"@cloudflare/workers-utils\": \"workspace:*\",\n\t\t\"@remix-run/node-fetch-server\": \"^0.8.0\",\n\t\t\"@types/node\": \"catalog:default\",\n\t\t\"@types/semver\": \"^7.5.1\",\n\t\t\"@types/ws\": \"^8.5.13\",\n\t\t\"defu\": \"^6.1.4\",\n\t\t\"get-port\": \"^7.1.0\",\n\t\t\"magic-string\": \"^0.30.12\",\n\t\t\"mlly\": \"^1.7.4\",\n\t\t\"open\": \"catalog:default\",\n\t\t\"picocolors\": \"^1.1.1\",\n\t\t\"semver\": \"^7.7.1\",\n\t\t\"tinyglobby\": \"^0.2.12\",\n\t\t\"tree-kill\": \"catalog:default\",\n\t\t\"tsdown\": \"0.16.3\",\n\t\t\"typescript\": \"catalog:default\",\n\t\t\"vite\": \"catalog:default\",\n\t\t\"vite-legacy\": \"npm:vite@7.1.12\",\n\t\t\"vitest\": \"catalog:default\"\n\t},\n\t\"peerDependencies\": {\n\t\t\"vite\": \"^6.1.0 || ^7.0.0 || ^8.0.0\",\n\t\t\"wrangler\": \"workspace:^\"\n\t},\n\t\"workers-sdk\": {\n\t\t\"prerelease\": true\n\t}\n}\n"],"mappings":";sBAAA;OACS;UACG;cACI;WACH;EACX;EACA;EACA;EACA;EACA;EACA;WACW;OACJ,EACP,OAAO,oDACP;UACU;aACG;EACb,QAAQ;EACR,OAAO;EACP,aAAa;EACb;QACQ,CACR,OACA;OACO;cACO;OACP;QACC;UACE,EACV,KAAK;EACJ,SAAS;EACT,UAAU;EACV,EACD;gBACgB,EAChB,UAAU,UACV;UACU;EACV,SAAS;EACT,cAAc;EACd,OAAO;EACP,QAAQ;EACR,WAAW;EACX,YAAY;EACZ,cAAc;EACd;eACe;EACf,4BAA4B;EAC5B,aAAa;EACb,SAAS;EACT,YAAY;EACZ,MAAM;EACN;kBACkB;EAClB,iCAAiC;EACjC,iCAAiC;EACjC,8BAA8B;EAC9B,gCAAgC;EAChC,6BAA6B;EAC7B,6BAA6B;EAC7B,gCAAgC;EAChC,eAAe;EACf,iBAAiB;EACjB,aAAa;EACb,QAAQ;EACR,YAAY;EACZ,gBAAgB;EAChB,QAAQ;EACR,QAAQ;EACR,cAAc;EACd,UAAU;EACV,cAAc;EACd,aAAa;EACb,UAAU;EACV,cAAc;EACd,QAAQ;EACR,eAAe;EACf,UAAU;EACV;mBACmB;EACnB,QAAQ;EACR,YAAY;EACZ;CACD,eAAe,EACd,cAAc,MACd;CACD"}
1
+ {"version":3,"file":"package-C8oIIiCo.mjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"@cloudflare/vite-plugin\",\n\t\"version\": \"1.33.0\",\n\t\"description\": \"Cloudflare plugin for Vite\",\n\t\"keywords\": [\n\t\t\"cloudflare\",\n\t\t\"cloudflare-workers\",\n\t\t\"vite\",\n\t\t\"vite-plugin\",\n\t\t\"workers\"\n\t],\n\t\"homepage\": \"https://github.com/cloudflare/workers-sdk/tree/main/packages/vite-plugin-cloudflare#readme\",\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/cloudflare/workers-sdk/issues\"\n\t},\n\t\"license\": \"MIT\",\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"https://github.com/cloudflare/workers-sdk.git\",\n\t\t\"directory\": \"packages/vite-plugin-cloudflare\"\n\t},\n\t\"files\": [\n\t\t\"dist\"\n\t],\n\t\"type\": \"module\",\n\t\"sideEffects\": false,\n\t\"main\": \"./dist/index.mjs\",\n\t\"types\": \"./dist/index.d.mts\",\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"types\": \"./dist/index.d.mts\",\n\t\t\t\"import\": \"./dist/index.mjs\"\n\t\t}\n\t},\n\t\"publishConfig\": {\n\t\t\"access\": \"public\"\n\t},\n\t\"scripts\": {\n\t\t\"build\": \"tsdown\",\n\t\t\"check:type\": \"tsc --build\",\n\t\t\"dev\": \"tsdown --watch\",\n\t\t\"test\": \"vitest run\",\n\t\t\"test:ci\": \"pnpm test\",\n\t\t\"test:e2e\": \"vitest run -c e2e/vitest.config.ts\",\n\t\t\"test:watch\": \"vitest\"\n\t},\n\t\"dependencies\": {\n\t\t\"@cloudflare/unenv-preset\": \"workspace:*\",\n\t\t\"miniflare\": \"workspace:*\",\n\t\t\"unenv\": \"2.0.0-rc.24\",\n\t\t\"wrangler\": \"workspace:*\",\n\t\t\"ws\": \"catalog:default\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@cloudflare/containers-shared\": \"workspace:*\",\n\t\t\"@cloudflare/mock-npm-registry\": \"workspace:*\",\n\t\t\"@cloudflare/workers-shared\": \"workspace:*\",\n\t\t\"@cloudflare/workers-tsconfig\": \"workspace:*\",\n\t\t\"@cloudflare/workers-types\": \"catalog:default\",\n\t\t\"@cloudflare/workers-utils\": \"workspace:*\",\n\t\t\"@remix-run/node-fetch-server\": \"^0.8.0\",\n\t\t\"@types/node\": \"catalog:default\",\n\t\t\"@types/semver\": \"^7.5.1\",\n\t\t\"@types/ws\": \"^8.5.13\",\n\t\t\"defu\": \"^6.1.4\",\n\t\t\"get-port\": \"^7.1.0\",\n\t\t\"magic-string\": \"^0.30.12\",\n\t\t\"mlly\": \"^1.7.4\",\n\t\t\"open\": \"catalog:default\",\n\t\t\"picocolors\": \"^1.1.1\",\n\t\t\"semver\": \"^7.7.1\",\n\t\t\"tinyglobby\": \"catalog:default\",\n\t\t\"tree-kill\": \"catalog:default\",\n\t\t\"tsdown\": \"0.16.3\",\n\t\t\"typescript\": \"catalog:default\",\n\t\t\"vite\": \"catalog:default\",\n\t\t\"vite-legacy\": \"npm:vite@7.1.12\",\n\t\t\"vitest\": \"catalog:default\"\n\t},\n\t\"peerDependencies\": {\n\t\t\"vite\": \"^6.1.0 || ^7.0.0 || ^8.0.0\",\n\t\t\"wrangler\": \"workspace:^\"\n\t},\n\t\"workers-sdk\": {\n\t\t\"prerelease\": true\n\t}\n}\n"],"mappings":";sBAAA;OACS;UACG;cACI;WACH;EACX;EACA;EACA;EACA;EACA;EACA;WACW;OACJ,EACP,OAAO,oDACP;UACU;aACG;EACb,QAAQ;EACR,OAAO;EACP,aAAa;EACb;QACQ,CACR,OACA;OACO;cACO;OACP;QACC;UACE,EACV,KAAK;EACJ,SAAS;EACT,UAAU;EACV,EACD;gBACgB,EAChB,UAAU,UACV;UACU;EACV,SAAS;EACT,cAAc;EACd,OAAO;EACP,QAAQ;EACR,WAAW;EACX,YAAY;EACZ,cAAc;EACd;eACe;EACf,4BAA4B;EAC5B,aAAa;EACb,SAAS;EACT,YAAY;EACZ,MAAM;EACN;kBACkB;EAClB,iCAAiC;EACjC,iCAAiC;EACjC,8BAA8B;EAC9B,gCAAgC;EAChC,6BAA6B;EAC7B,6BAA6B;EAC7B,gCAAgC;EAChC,eAAe;EACf,iBAAiB;EACjB,aAAa;EACb,QAAQ;EACR,YAAY;EACZ,gBAAgB;EAChB,QAAQ;EACR,QAAQ;EACR,cAAc;EACd,UAAU;EACV,cAAc;EACd,aAAa;EACb,UAAU;EACV,cAAc;EACd,QAAQ;EACR,eAAe;EACf,UAAU;EACV;mBACmB;EACnB,QAAQ;EACR,YAAY;EACZ;CACD,eAAe,EACd,cAAc,MACd;CACD"}
@@ -5606,115 +5606,131 @@ async function getAssetWithMetadataFromKV(assetsKVNamespace, assetKey, sentry, r
5606
5606
 
5607
5607
  //#endregion
5608
5608
  //#region ../workers-shared/asset-worker/src/worker.ts
5609
- var worker_default = class extends WorkerEntrypoint {
5610
- async fetch(request) {
5611
- let sentry;
5612
- const analytics = new Analytics(this.env.ANALYTICS);
5613
- const performance = new PerformanceTimer(this.env.UNSAFE_PERFORMANCE);
5609
+ async function unstableExistsImpl(env, pathname, _request) {
5610
+ const analytics = new ExperimentAnalytics(env.EXPERIMENT_ANALYTICS);
5611
+ const performance = new PerformanceTimer(env.UNSAFE_PERFORMANCE);
5612
+ return (env.JAEGER ?? mockJaegerBinding()).enterSpan("unstable_exists", async (span) => {
5613
+ if (env.COLO_METADATA && env.VERSION_METADATA && env.CONFIG) analytics.setData({
5614
+ accountId: env.CONFIG.account_id,
5615
+ experimentName: "manifest-read-timing"
5616
+ });
5614
5617
  const startTimeMs = performance.now();
5615
5618
  try {
5616
- this.env.JAEGER ??= mockJaegerBinding();
5617
- sentry = setupSentry(request, this.ctx, this.env.SENTRY_DSN, this.env.SENTRY_ACCESS_CLIENT_ID, this.env.SENTRY_ACCESS_CLIENT_SECRET, this.env.COLO_METADATA, this.env.VERSION_METADATA, this.env.CONFIG?.account_id, this.env.CONFIG?.script_id);
5618
- const config = normalizeConfiguration(this.env.CONFIG);
5619
- sentry?.setContext("compatibilityOptions", {
5620
- compatibilityDate: config.compatibility_date,
5621
- compatibilityFlags: config.compatibility_flags,
5622
- originalCompatibilityFlags: this.env.CONFIG.compatibility_flags
5623
- });
5624
- const userAgent = request.headers.get("user-agent") ?? "UA UNKNOWN";
5625
- const url = new URL(request.url);
5626
- if (this.env.COLO_METADATA && this.env.VERSION_METADATA && this.env.CONFIG) analytics.setData({
5627
- accountId: this.env.CONFIG.account_id,
5628
- scriptId: this.env.CONFIG.script_id,
5629
- coloId: this.env.COLO_METADATA.coloId,
5630
- metalId: this.env.COLO_METADATA.metalId,
5631
- coloTier: this.env.COLO_METADATA.coloTier,
5632
- coloRegion: this.env.COLO_METADATA.coloRegion,
5633
- version: this.env.VERSION_METADATA.tag,
5634
- hostname: url.hostname,
5635
- htmlHandling: config.html_handling,
5636
- notFoundHandling: config.not_found_handling,
5637
- compatibilityFlags: config.compatibility_flags,
5638
- userAgent
5639
- });
5640
- return await this.env.JAEGER.enterSpan("handleRequest", async (span) => {
5641
- span.setTags({
5642
- hostname: url.hostname,
5643
- eyeballPath: url.pathname,
5644
- env: this.env.ENVIRONMENT,
5645
- version: this.env.VERSION_METADATA?.id
5646
- });
5647
- const response = await handleRequest(request, this.env, config, this.unstable_exists.bind(this), this.unstable_getByETag.bind(this), analytics);
5648
- analytics.setData({ status: response.status });
5649
- return response;
5619
+ const eTag = await new AssetsManifest(env.ASSETS_MANIFEST).get(pathname);
5620
+ span.setTags({
5621
+ path: pathname,
5622
+ found: eTag !== null,
5623
+ etag: eTag ?? ""
5650
5624
  });
5651
- } catch (err) {
5652
- return handleError(sentry, analytics, err);
5625
+ return eTag;
5653
5626
  } finally {
5654
- submitMetrics(analytics, performance, startTimeMs);
5627
+ analytics.setData({ manifestReadTime: performance.now() - startTimeMs });
5628
+ analytics.write();
5655
5629
  }
5630
+ });
5631
+ }
5632
+ async function unstableGetByETagImpl(env, eTag, _request) {
5633
+ const performance = new PerformanceTimer(env.UNSAFE_PERFORMANCE);
5634
+ return (env.JAEGER ?? mockJaegerBinding()).enterSpan("unstable_getByETag", async (span) => {
5635
+ const startTime = performance.now();
5636
+ const asset = await getAssetWithMetadataFromKV(env.ASSETS_KV_NAMESPACE, eTag);
5637
+ const assetFetchTime = performance.now() - startTime;
5638
+ if (!asset || !asset.value) {
5639
+ span.setTags({ error: true });
5640
+ span.addLogs({ error: `Requested asset ${eTag} exists in the asset manifest but not in the KV namespace.` });
5641
+ throw new Error(`Requested asset ${eTag} exists in the asset manifest but not in the KV namespace.`);
5642
+ }
5643
+ const cacheStatus = assetFetchTime <= 100 ? "HIT" : "MISS";
5644
+ span.setTags({
5645
+ etag: eTag,
5646
+ contentType: asset.metadata?.contentType ?? "unknown",
5647
+ cacheStatus
5648
+ });
5649
+ return {
5650
+ readableStream: asset.value,
5651
+ contentType: asset.metadata?.contentType,
5652
+ cacheStatus
5653
+ };
5654
+ });
5655
+ }
5656
+ async function unstableGetByPathnameImpl(env, exists, getByETag, pathname, request) {
5657
+ return (env.JAEGER ?? mockJaegerBinding()).enterSpan("unstable_getByPathname", async (span) => {
5658
+ const eTag = await exists(pathname, request);
5659
+ span.setTags({
5660
+ path: pathname,
5661
+ found: eTag !== null
5662
+ });
5663
+ if (!eTag) return null;
5664
+ return getByETag(eTag, request);
5665
+ });
5666
+ }
5667
+ async function runFetchRequest(request, env, ctx, exists, getByETag) {
5668
+ let sentry;
5669
+ const analytics = new Analytics(env.ANALYTICS);
5670
+ const performance = new PerformanceTimer(env.UNSAFE_PERFORMANCE);
5671
+ const startTimeMs = performance.now();
5672
+ try {
5673
+ env.JAEGER ??= mockJaegerBinding();
5674
+ sentry = setupSentry(request, ctx, env.SENTRY_DSN, env.SENTRY_ACCESS_CLIENT_ID, env.SENTRY_ACCESS_CLIENT_SECRET, env.COLO_METADATA, env.VERSION_METADATA, env.CONFIG?.account_id, env.CONFIG?.script_id);
5675
+ const config = normalizeConfiguration(env.CONFIG);
5676
+ sentry?.setContext("compatibilityOptions", {
5677
+ compatibilityDate: config.compatibility_date,
5678
+ compatibilityFlags: config.compatibility_flags,
5679
+ originalCompatibilityFlags: env.CONFIG.compatibility_flags
5680
+ });
5681
+ const userAgent = request.headers.get("user-agent") ?? "UA UNKNOWN";
5682
+ const url = new URL(request.url);
5683
+ if (env.COLO_METADATA && env.VERSION_METADATA && env.CONFIG) analytics.setData({
5684
+ accountId: env.CONFIG.account_id,
5685
+ scriptId: env.CONFIG.script_id,
5686
+ coloId: env.COLO_METADATA.coloId,
5687
+ metalId: env.COLO_METADATA.metalId,
5688
+ coloTier: env.COLO_METADATA.coloTier,
5689
+ coloRegion: env.COLO_METADATA.coloRegion,
5690
+ version: env.VERSION_METADATA.tag,
5691
+ hostname: url.hostname,
5692
+ htmlHandling: config.html_handling,
5693
+ notFoundHandling: config.not_found_handling,
5694
+ compatibilityFlags: config.compatibility_flags,
5695
+ userAgent
5696
+ });
5697
+ return await env.JAEGER.enterSpan("handleRequest", async (span) => {
5698
+ span.setTags({
5699
+ hostname: url.hostname,
5700
+ eyeballPath: url.pathname,
5701
+ env: env.ENVIRONMENT,
5702
+ version: env.VERSION_METADATA?.id
5703
+ });
5704
+ const response = await handleRequest(request, env, config, exists, getByETag, analytics);
5705
+ analytics.setData({ status: response.status });
5706
+ return response;
5707
+ });
5708
+ } catch (err) {
5709
+ return handleError(sentry, analytics, err);
5710
+ } finally {
5711
+ submitMetrics(analytics, performance, startTimeMs);
5712
+ }
5713
+ }
5714
+ var AssetWorkerInner = class extends WorkerEntrypoint {
5715
+ async fetch(request) {
5716
+ this.env.JAEGER ??= mockJaegerBinding();
5717
+ const traceContext = this.ctx.props?.traceContext ?? null;
5718
+ const response = await this.env.JAEGER.runWithSpanContext(traceContext, () => runFetchRequest(request, this.env, this.ctx, this.unstable_exists.bind(this), this.unstable_getByETag.bind(this)));
5719
+ if (response instanceof Response) return response;
5720
+ throw new Error("AssetWorkerInner fetch returned non-Response value.");
5656
5721
  }
5657
5722
  async unstable_canFetch(request) {
5658
5723
  this.env.JAEGER ??= mockJaegerBinding();
5659
5724
  return canFetch(request, this.env, normalizeConfiguration(this.env.CONFIG), this.unstable_exists.bind(this));
5660
5725
  }
5661
- async unstable_getByETag(eTag, _request) {
5662
- const performance = new PerformanceTimer(this.env.UNSAFE_PERFORMANCE);
5663
- return (this.env.JAEGER ?? mockJaegerBinding()).enterSpan("unstable_getByETag", async (span) => {
5664
- const startTime = performance.now();
5665
- const asset = await getAssetWithMetadataFromKV(this.env.ASSETS_KV_NAMESPACE, eTag);
5666
- const assetFetchTime = performance.now() - startTime;
5667
- if (!asset || !asset.value) {
5668
- span.setTags({ error: true });
5669
- span.addLogs({ error: `Requested asset ${eTag} exists in the asset manifest but not in the KV namespace.` });
5670
- throw new Error(`Requested asset ${eTag} exists in the asset manifest but not in the KV namespace.`);
5671
- }
5672
- const cacheStatus = assetFetchTime <= 100 ? "HIT" : "MISS";
5673
- span.setTags({
5674
- etag: eTag,
5675
- contentType: asset.metadata?.contentType ?? "unknown",
5676
- cacheStatus
5677
- });
5678
- return {
5679
- readableStream: asset.value,
5680
- contentType: asset.metadata?.contentType,
5681
- cacheStatus
5682
- };
5683
- });
5726
+ async unstable_getByETag(eTag, request) {
5727
+ return unstableGetByETagImpl(this.env, eTag, request);
5684
5728
  }
5685
5729
  async unstable_getByPathname(pathname, request) {
5686
- return (this.env.JAEGER ?? mockJaegerBinding()).enterSpan("unstable_getByPathname", async (span) => {
5687
- const eTag = await this.unstable_exists(pathname, request);
5688
- span.setTags({
5689
- path: pathname,
5690
- found: eTag !== null
5691
- });
5692
- if (!eTag) return null;
5693
- return this.unstable_getByETag(eTag, request);
5694
- });
5730
+ return unstableGetByPathnameImpl(this.env, this.unstable_exists.bind(this), this.unstable_getByETag.bind(this), pathname, request);
5695
5731
  }
5696
- async unstable_exists(pathname, _request) {
5697
- const analytics = new ExperimentAnalytics(this.env.EXPERIMENT_ANALYTICS);
5698
- const performance = new PerformanceTimer(this.env.UNSAFE_PERFORMANCE);
5699
- return (this.env.JAEGER ?? mockJaegerBinding()).enterSpan("unstable_exists", async (span) => {
5700
- if (this.env.COLO_METADATA && this.env.VERSION_METADATA && this.env.CONFIG) analytics.setData({
5701
- accountId: this.env.CONFIG.account_id,
5702
- experimentName: "manifest-read-timing"
5703
- });
5704
- const startTimeMs = performance.now();
5705
- try {
5706
- const eTag = await new AssetsManifest(this.env.ASSETS_MANIFEST).get(pathname);
5707
- span.setTags({
5708
- path: pathname,
5709
- found: eTag !== null,
5710
- etag: eTag ?? ""
5711
- });
5712
- return eTag;
5713
- } finally {
5714
- analytics.setData({ manifestReadTime: performance.now() - startTimeMs });
5715
- analytics.write();
5716
- }
5717
- });
5732
+ async unstable_exists(pathname, request) {
5733
+ return unstableExistsImpl(this.env, pathname, request);
5718
5734
  }
5719
5735
  };
5720
5736
 
@@ -5727,7 +5743,7 @@ const VIRTUAL_EXPORT_TYPES = `${virtualPrefix}export-types`;
5727
5743
 
5728
5744
  //#endregion
5729
5745
  //#region src/workers/asset-worker/index.ts
5730
- var CustomAssetWorker = class extends worker_default {
5746
+ var CustomAssetWorker = class extends AssetWorkerInner {
5731
5747
  async fetch(request) {
5732
5748
  const response = await super.fetch(request);
5733
5749
  const modifiedResponse = new Response(response.body, response);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudflare/vite-plugin",
3
- "version": "1.32.2",
3
+ "version": "1.33.0",
4
4
  "description": "Cloudflare plugin for Vite",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -39,11 +39,11 @@
39
39
  "unenv": "2.0.0-rc.24",
40
40
  "ws": "8.18.0",
41
41
  "@cloudflare/unenv-preset": "2.16.0",
42
- "miniflare": "4.20260410.0",
43
- "wrangler": "4.82.2"
42
+ "miniflare": "4.20260420.0",
43
+ "wrangler": "4.84.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@cloudflare/workers-types": "^4.20260410.1",
46
+ "@cloudflare/workers-types": "^4.20260420.1",
47
47
  "@remix-run/node-fetch-server": "^0.8.0",
48
48
  "@types/node": "^22.10.1",
49
49
  "@types/semver": "^7.5.1",
@@ -62,15 +62,15 @@
62
62
  "vite": "^8.0.0",
63
63
  "vite-legacy": "npm:vite@7.1.12",
64
64
  "vitest": "4.1.0",
65
- "@cloudflare/containers-shared": "0.13.1",
65
+ "@cloudflare/containers-shared": "0.14.0",
66
66
  "@cloudflare/mock-npm-registry": "0.0.0",
67
- "@cloudflare/workers-shared": "0.19.1",
67
+ "@cloudflare/workers-shared": "0.19.2",
68
68
  "@cloudflare/workers-tsconfig": "0.0.0",
69
- "@cloudflare/workers-utils": "0.16.0"
69
+ "@cloudflare/workers-utils": "0.17.0"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "vite": "^6.1.0 || ^7.0.0 || ^8.0.0",
73
- "wrangler": "^4.82.2"
73
+ "wrangler": "^4.84.0"
74
74
  },
75
75
  "workers-sdk": {
76
76
  "prerelease": true