@astrojs/cloudflare 13.5.3 → 13.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.
@@ -88,7 +88,7 @@ function serverStart({
88
88
  host,
89
89
  base
90
90
  }) {
91
- const version = "13.5.3";
91
+ const version = "13.5.5";
92
92
  const localPrefix = `${colors.dim("\u2503")} Local `;
93
93
  const networkPrefix = `${colors.dim("\u2503")} Network `;
94
94
  const emptyPrefix = " ".repeat(11);
package/dist/index.js CHANGED
@@ -1,5 +1,8 @@
1
1
  import { createReadStream, existsSync, readFileSync } from "node:fs";
2
- import { appendFile, readFile, rename, stat } from "node:fs/promises";
2
+ import { appendFile, readFile, rename, stat, writeFile } from "node:fs/promises";
3
+ import { relative } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import { normalizePath } from "vite";
3
6
  import { createInterface } from "node:readline/promises";
4
7
  import { removeLeadingForwardSlash } from "@astrojs/internal-helpers/path";
5
8
  import { createRedirectsFromAstroRoutes, printAsRedirects } from "@astrojs/underscore-redirects";
@@ -133,6 +136,7 @@ function createIntegration({
133
136
  "@astrojs/prism > prismjs/dependencies.js"
134
137
  ];
135
138
  const isAstroPrismPackageInstalled = await getIsAstroPrismInstalled(config.root);
139
+ const userOptimizeDeps = config.vite?.optimizeDeps;
136
140
  updateConfig({
137
141
  build: {
138
142
  redirects: false
@@ -195,7 +199,8 @@ function createIntegration({
195
199
  "astro/jsx-runtime",
196
200
  "astro/app/entrypoint/dev",
197
201
  "astro/virtual-modules/middleware.js",
198
- ...isAstroPrismPackageInstalled ? prismFiles : []
202
+ ...isAstroPrismPackageInstalled ? prismFiles : [],
203
+ ...Array.isArray(userOptimizeDeps?.include) ? userOptimizeDeps.include : []
199
204
  ],
200
205
  exclude: [
201
206
  "unstorage/drivers/cloudflare-kv-binding",
@@ -203,7 +208,8 @@ function createIntegration({
203
208
  "virtual:astro:*",
204
209
  "virtual:astro-cloudflare:*",
205
210
  "virtual:@astrojs/*",
206
- "@astrojs/starlight"
211
+ "@astrojs/starlight",
212
+ ...Array.isArray(userOptimizeDeps?.exclude) ? userOptimizeDeps.exclude : []
207
213
  ],
208
214
  esbuildOptions: {
209
215
  // Suppress Vite's `createRequire(import.meta.url)` banner to work around
@@ -211,7 +217,8 @@ function createIntegration({
211
217
  // incorrectly rewrites identifiers inside `import.meta` when an imported
212
218
  // binding shares the same name (e.g. zod v4 exports `meta`).
213
219
  banner: { js: "" },
214
- plugins: [astroFrontmatterScanPlugin()]
220
+ plugins: [astroFrontmatterScanPlugin()],
221
+ ...userOptimizeDeps?.esbuildOptions?.loader ? { loader: userOptimizeDeps.esbuildOptions.loader } : {}
215
222
  }
216
223
  }
217
224
  };
@@ -356,6 +363,18 @@ function createIntegration({
356
363
  } catch {
357
364
  }
358
365
  }
366
+ try {
367
+ const wranglerJsonUrl = new URL("./wrangler.json", _config.build.server);
368
+ const raw = await readFile(wranglerJsonUrl, "utf-8");
369
+ const wranglerConfig = JSON.parse(raw);
370
+ if (wranglerConfig.assets?.directory) {
371
+ wranglerConfig.assets.directory = normalizePath(
372
+ relative(fileURLToPath(_config.build.server), fileURLToPath(_originalClientDir))
373
+ );
374
+ await writeFile(wranglerJsonUrl, JSON.stringify(wranglerConfig));
375
+ }
376
+ } catch {
377
+ }
359
378
  }
360
379
  let redirectsExists = false;
361
380
  try {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astrojs/cloudflare",
3
3
  "description": "Deploy your site to Cloudflare Workers",
4
- "version": "13.5.3",
4
+ "version": "13.5.5",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -53,7 +53,7 @@
53
53
  "cheerio": "1.2.0",
54
54
  "devalue": "^5.6.3",
55
55
  "prismjs": "^1.30.0",
56
- "astro": "6.3.6",
56
+ "astro": "6.3.8",
57
57
  "astro-scripts": "0.0.14"
58
58
  },
59
59
  "publishConfig": {