@astrojs/cloudflare 12.0.1 → 12.1.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/dist/index.js +10 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { appendForwardSlash, prependForwardSlash, removeLeadingForwardSlash, } f
|
|
|
5
5
|
import { createRedirectsFromAstroRoutes } from '@astrojs/underscore-redirects';
|
|
6
6
|
import astroWhen from '@inox-tools/astro-when';
|
|
7
7
|
import { AstroError } from 'astro/errors';
|
|
8
|
-
import {
|
|
8
|
+
import { defaultClientConditions } from 'vite';
|
|
9
9
|
import { getPlatformProxy } from 'wrangler';
|
|
10
10
|
import { cloudflareModuleLoader, } from './utils/cloudflare-module-loader.js';
|
|
11
11
|
import { createGetEnv } from './utils/env.js';
|
|
@@ -59,8 +59,14 @@ export default function createIntegration(args) {
|
|
|
59
59
|
integrations: [astroWhen()],
|
|
60
60
|
image: setImageConfig(args?.imageService ?? 'compile', config.image, command, logger),
|
|
61
61
|
});
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
if (args?.platformProxy?.configPath) {
|
|
63
|
+
addWatchFile(new URL(args.platformProxy.configPath, config.root));
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
addWatchFile(new URL('./wrangler.toml', config.root));
|
|
67
|
+
addWatchFile(new URL('./wrangler.json', config.root));
|
|
68
|
+
addWatchFile(new URL('./wrangler.jsonc', config.root));
|
|
69
|
+
}
|
|
64
70
|
addMiddleware({
|
|
65
71
|
entrypoint: '@astrojs/cloudflare/entrypoints/middleware.js',
|
|
66
72
|
order: 'pre',
|
|
@@ -135,7 +141,7 @@ export default function createIntegration(args) {
|
|
|
135
141
|
// (previously supported in esbuild instead: https://github.com/withastro/astro/pull/7092)
|
|
136
142
|
vite.ssr ||= {};
|
|
137
143
|
vite.ssr.resolve ||= {};
|
|
138
|
-
vite.ssr.resolve.conditions ||= [...
|
|
144
|
+
vite.ssr.resolve.conditions ||= [...defaultClientConditions];
|
|
139
145
|
vite.ssr.resolve.conditions.push('workerd', 'worker');
|
|
140
146
|
vite.ssr.target = 'webworker';
|
|
141
147
|
vite.ssr.noExternal = true;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/cloudflare",
|
|
3
3
|
"description": "Deploy your site to Cloudflare Workers/Pages",
|
|
4
|
-
"version": "12.0
|
|
4
|
+
"version": "12.1.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "withastro",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@astrojs/internal-helpers": "0.4.1",
|
|
33
33
|
"@astrojs/underscore-redirects": "^0.4.0-alpha.0",
|
|
34
34
|
"@cloudflare/workers-types": "^4.20241112.0",
|
|
35
|
-
"@inox-tools/astro-when": "^0.
|
|
35
|
+
"@inox-tools/astro-when": "^1.0.1",
|
|
36
36
|
"esbuild": "^0.24.0",
|
|
37
37
|
"estree-walker": "^3.0.3",
|
|
38
38
|
"magic-string": "^0.30.14",
|