Skip to content

Commit 6854b6f

Browse files
Merge branch 'main' into netlify
2 parents 2d813bd + 0e4b09e commit 6854b6f

File tree

4 files changed

+8
-192
lines changed

4 files changed

+8
-192
lines changed

src/content/docs/en/guides/deploy/cloudflare.mdx

Lines changed: 3 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,8 @@ import { Steps } from '@astrojs/starlight/components';
1313
import StaticSsrTabs from '~/components/tabs/StaticSsrTabs.astro';
1414
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'
1515

16-
You can deploy full-stack applications, including front-end static assets and back-end APIs, as well as on-demand rendered sites, to both [Cloudflare Workers](https://developers.cloudflare.com/workers/static-assets/) and [Cloudflare Pages](https://pages.cloudflare.com/).
16+
You can deploy full-stack applications, including front-end static assets and back-end APIs, as well as on-demand rendered sites, to [Cloudflare Workers](https://developers.cloudflare.com/workers/static-assets/).
1717

18-
This guide includes:
19-
20-
- [How to deploy to Cloudflare Workers](#cloudflare-workers)
21-
- [How to deploy to Cloudflare Pages](#cloudflare-pages)
2218

2319
:::note
2420

@@ -125,14 +121,14 @@ After your assets are uploaded, Wrangler will give you a preview URL to inspect
125121

126122
### How to deploy with CI/CD
127123

128-
You can also use a CI/CD system such as [Workers Builds (BETA)](https://developers.cloudflare.com/workers/ci-cd/builds/) to automatically build and deploy your site on push.
124+
You can also use a CI/CD system such as [Workers Builds](https://developers.cloudflare.com/workers/ci-cd/builds/) to automatically build and deploy your site on push.
129125

130126
If you're using Workers Builds:
131127

132128
<Steps>
133129
1. Follow Steps 1-3 from the Wrangler section above.
134130

135-
2. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and navigate to `Workers & Pages`. Select `Create`.
131+
2. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and navigate to `Compute > Workers & Pages`. Select `Create application`.
136132

137133
3. Under `Import a repository`, select a Git account and then the repository containing your Astro project.
138134

@@ -143,144 +139,6 @@ If you're using Workers Builds:
143139
5. Click `Save and Deploy`. You can now preview your Worker at its provided `workers.dev` subdomain.
144140
</Steps>
145141

146-
## Cloudflare Pages
147-
148-
### How to deploy with Wrangler
149-
150-
<Steps>
151-
1. Install [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/get-started/).
152-
153-
<PackageManagerTabs>
154-
<Fragment slot="npm">
155-
```sh
156-
npm install wrangler@latest --save-dev
157-
```
158-
</Fragment>
159-
<Fragment slot="pnpm">
160-
```sh
161-
pnpm add wrangler@latest --save-dev
162-
```
163-
</Fragment>
164-
<Fragment slot="yarn">
165-
```sh
166-
yarn add wrangler@latest --dev
167-
```
168-
</Fragment>
169-
</PackageManagerTabs>
170-
171-
2. If your site uses on-demand rendering, install the [`@astrojs/cloudflare` adapter](/en/guides/integrations-guide/cloudflare/).
172-
173-
This will install the adapter and make the appropriate changes to your `astro.config.mjs` file in one step.
174-
175-
<PackageManagerTabs>
176-
<Fragment slot="npm">
177-
```sh
178-
npx astro add cloudflare
179-
```
180-
</Fragment>
181-
<Fragment slot="pnpm">
182-
```sh
183-
pnpm astro add cloudflare
184-
```
185-
</Fragment>
186-
<Fragment slot="yarn">
187-
```sh
188-
yarn astro add cloudflare
189-
```
190-
</Fragment>
191-
</PackageManagerTabs>
192-
193-
3. Create a [Wrangler configuration file](https://developers.cloudflare.com/workers/wrangler/configuration/).
194-
195-
Because Cloudflare recommends new projects use Workers instead of Pages, the `astro add cloudflare` command creates a `wrangler.jsonc` and `public/.assetsignore` file, which are specific to Workers projects. You will need to delete the `public/.assetsignore` file and change your `wrangler.jsonc` file. If you are not using the adapter you'll need to create it yourself.
196-
197-
Ensure your `wrangler.jsonc` file is structured like this:
198-
199-
<StaticSsrTabs>
200-
<Fragment slot="static">
201-
```jsonc title="wrangler.jsonc"
202-
{
203-
"name": "my-astro-app",
204-
"compatibility_date": "YYYY-MM-DD", // Update to the day you deploy
205-
"pages_build_output_dir": "./dist"
206-
}
207-
```
208-
</Fragment>
209-
<Fragment slot="ssr">
210-
```jsonc title="wrangler.jsonc"
211-
{
212-
"name": "my-astro-app",
213-
"compatibility_date": "YYYY-MM-DD", // Update to the day you deploy
214-
"compatibility_flags": [
215-
"nodejs_compat",
216-
"disable_nodejs_process_v2"
217-
],
218-
"pages_build_output_dir": "./dist"
219-
}
220-
```
221-
</Fragment>
222-
</StaticSsrTabs>
223-
224-
<ReadMore>Read more about [on-demand rendering in Astro](/en/guides/on-demand-rendering/).</ReadMore>
225-
226-
3. Preview your project locally with Wrangler.
227-
228-
<PackageManagerTabs>
229-
<Fragment slot="npm">
230-
```sh
231-
npx astro build && wrangler pages dev ./dist
232-
```
233-
</Fragment>
234-
<Fragment slot="pnpm">
235-
```sh
236-
pnpm astro build && wrangler pages dev ./dist
237-
```
238-
</Fragment>
239-
<Fragment slot="yarn">
240-
```sh
241-
yarn astro build && wrangler pages dev ./dist
242-
```
243-
</Fragment>
244-
</PackageManagerTabs>
245-
246-
4. Deploy using `npx wrangler deploy`.
247-
248-
<PackageManagerTabs>
249-
<Fragment slot="npm">
250-
```sh
251-
npx astro build && wrangler pages deploy ./dist
252-
```
253-
</Fragment>
254-
<Fragment slot="pnpm">
255-
```sh
256-
pnpm astro build && wrangler pages deploy ./dist
257-
```
258-
</Fragment>
259-
<Fragment slot="yarn">
260-
```sh
261-
yarn astro build && wrangler pages deploy ./dist
262-
```
263-
</Fragment>
264-
</PackageManagerTabs>
265-
</Steps>
266-
267-
After your assets are uploaded, Wrangler will give you a preview URL to inspect your site.
268-
269-
### How to deploy a site with CI/CD
270-
271-
<Steps>
272-
1. Push your code to your git repository (e.g. GitHub, GitLab).
273-
274-
2. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and navigate to **Compute (Workers) > Workers & Pages**. Select **Create** and then select the **Pages** tab. Connect your git repository.
275-
276-
3. Configure your project with:
277-
- **Framework preset**: `Astro`
278-
- **Build command:** `npm run build`
279-
- **Build output directory:** `dist`
280-
281-
4. Click the **Save and Deploy** button.
282-
</Steps>
283-
284142
## Troubleshooting
285143

286144
### 404 behavior
@@ -296,8 +154,6 @@ For Workers projects, you will need to set `not_found_handling` if you want to s
296154
}
297155
```
298156

299-
For Pages projects, if you include a custom 404 page, it will be served by default. Otherwise, Pages will default to [Cloudflare's single-page application rendering behavior](https://developers.cloudflare.com/pages/configuration/serving-pages/#single-page-application-spa-rendering) and redirect to the home page instead of showing a 404 page.
300-
301157
### Client-side hydration
302158

303159
Client-side hydration may fail as a result of Cloudflare's Auto Minify setting. If you see `Hydration completed but contains mismatches` in the console, make sure to disable Auto Minify under Cloudflare settings.

src/content/docs/en/guides/integrations-guide/cloudflare.mdx

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -428,43 +428,6 @@ export default defineConfig({
428428
});
429429
```
430430

431-
## Using with Cloudflare Pages
432-
433-
The Cloudflare adapter deploys to Cloudflare Workers by default. To deploy to Cloudflare Pages instead, additional manual configuration is required.
434-
435-
:::caution
436-
Cloudflare recommends using Workers for new projects. See Cloudflare's [migration guide from Pages to Workers](https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/) for more information if you have an existing project using Pages.
437-
:::
438-
439-
<Steps>
440-
1. Configure your build output directories in `astro.config.mjs`:
441-
442-
```js title="astro.config.mjs" ins={6-9}
443-
import { defineConfig } from 'astro/config';
444-
import cloudflare from '@astrojs/cloudflare';
445-
446-
export default defineConfig({
447-
adapter: cloudflare(),
448-
build: {
449-
client: './',
450-
server: './_worker.js',
451-
},
452-
});
453-
```
454-
455-
2. Create a `_routes.json` file in your `public/` folder to route requests to your Worker:
456-
457-
```jsonc title="public/_routes.json"
458-
{
459-
"version": 1,
460-
"include": ["/*"], // Alternatively, specify specific routes
461-
"exclude": ["/static/*"] // Exclude static assets if needed
462-
}
463-
```
464-
465-
See the [Cloudflare documentation on routing with Pages](https://developers.cloudflare.com/pages/functions/routing/#create-a-_routesjson-file) for more details.
466-
</Steps>
467-
468431
## Upgrading to v13 and Astro 6
469432

470433
Astro 6 brings significant improvements to the Cloudflare development experience and requires `@astrojs/cloudflare` v13 or later. Now, `astro dev` uses Cloudflare's Vite plugin and `workerd` runtime to closely mirror production behavior.
@@ -677,14 +640,12 @@ export default defineConfig({
677640

678641
Use `astro preview` to test your Cloudflare Workers application locally before deploying. The preview runs using Cloudflare's `workerd` runtime, closely mirroring production behavior. Run `astro build` followed by `astro preview` to start the preview server.
679642

680-
### Deprecated: Cloudflare Pages support
643+
### Removed: Cloudflare Pages support
681644

682-
The Astro Cloudflare adapter now only supports deploying to Cloudflare Workers by default. If you are currently deploying to Cloudflare Pages, consider migrating to Workers for the best experience and feature support.
645+
The Astro Cloudflare adapter no longer supports deployment on Cloudflare Pages. For the best experience and feature support, you should migrate to Cloudflare Workers.
683646

684647
<ReadMore>See Cloudflare's [migration guide from Pages to Workers](https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/) for detailed migration instructions.</ReadMore>
685648

686-
If you need to continue using Cloudflare Pages, see [Using with Cloudflare Pages](#using-with-cloudflare-pages) for the required manual configuration.
687-
688649
### Changed: `imageService` default
689650

690651
The default value of `imageService` has changed from `'compile'` to `'cloudflare-binding'` for an improved experience when working with images.

src/content/docs/ko/guides/environment-variables.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ Astro는 몇 가지 기본 환경 변수를 포함합니다.
5858
- `import.meta.env.DEV`: 사이트가 개발 환경에서 실행 중이면 `true`, 그렇지 않으면 `false`입니다. 항상 `import.meta.env.PROD`의 반대입니다.
5959
- `import.meta.env.BASE_URL`: 사이트가 제공되는 기본 URL입니다. [`base` 구성 옵션](/ko/reference/configuration-reference/#base)에 의해 결정됩니다.
6060
- `import.meta.env.SITE`: 프로젝트의 `astro.config`에 지정된 [`site` 옵션](/ko/reference/configuration-reference/#site)으로 설정됩니다.
61-
- `import.meta.env.ASSETS_PREFIX`: [`build.assetsPrefix` 구성 옵션](/ko/reference/configuration-reference/#buildassetsprefix)이 설정된 경우 Astro에서 생성된 자산 링크의 접두사입니다. Astro에서 처리하지 않는 자산 링크를 생성하는 데 사용할 수 있습니다.
6261

6362
다른 환경 변수처럼 사용하세요.
6463

@@ -320,7 +319,7 @@ envField.enum({
320319
})
321320
```
322321
323-
<ReadMore>유효성 검사 필드의 전체 목록은 [`envField` API 참조](/ko/reference/configuration-reference/#envschema)를 확인하세요.</ReadMore>
322+
<ReadMore>유효성 검사 필드의 전체 목록은 [`envField` API 참조](/ko/reference/modules/astro-config/)를 확인하세요.</ReadMore>
324323
325324
## 비밀 변수를 동적으로 검색
326325

src/content/docs/ko/reference/cli-reference.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,13 +419,13 @@ astro --config config/astro.config.mjs dev
419419

420420
<p><Since v="5.0.0" /></p>
421421

422-
[콘텐츠 레이어 캐시](/ko/guides/content-collections/#컬렉션-loader-정의) 지우고 전체 리빌드를 강제 실행합니다.
422+
콘텐츠 레이어 캐시를 지우고 전체 리빌드를 강제 실행합니다.
423423

424424
### `--mode <string>`
425425

426426
<p><Since v="5.0.0" /></p>
427427

428-
프로젝트의 인라인 [`mode`](/ko/reference/programmatic-reference/#mode) 구성을 설정합니다.
428+
프로젝트의 인라인 [`mode`](/ko/reference/programmatic-reference/) 구성을 설정합니다.
429429

430430
### `--outDir <path>`
431431

0 commit comments

Comments
 (0)