Add Cloudflare Workers configuration
This commit is contained in:
committed by
GitHub
parent
49b0f6ae23
commit
082b1960f6
@@ -31,3 +31,9 @@ artifacts/previews/
|
|||||||
artifacts/imagegen/
|
artifacts/imagegen/
|
||||||
artifacts/qa-test/*/responsive-v12-pass2/
|
artifacts/qa-test/*/responsive-v12-pass2/
|
||||||
artifacts/qa-test/*/deploy-sftp-dryrun.txt
|
artifacts/qa-test/*/deploy-sftp-dryrun.txt
|
||||||
|
|
||||||
|
# wrangler files
|
||||||
|
.wrangler
|
||||||
|
.dev.vars*
|
||||||
|
!.dev.vars.example
|
||||||
|
!.env.example
|
||||||
|
|||||||
+7
-2
@@ -2,12 +2,17 @@ import { defineConfig } from 'astro/config';
|
|||||||
import react from '@astrojs/react';
|
import react from '@astrojs/react';
|
||||||
import tailwindcss from '@tailwindcss/vite';
|
import tailwindcss from '@tailwindcss/vite';
|
||||||
|
|
||||||
|
import cloudflare from '@astrojs/cloudflare';
|
||||||
|
|
||||||
const siteUrl = process.env.PUBLIC_SITE_URL || 'https://electron-rare.github.io/';
|
const siteUrl = process.env.PUBLIC_SITE_URL || 'https://electron-rare.github.io/';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
site: siteUrl,
|
site: siteUrl,
|
||||||
integrations: [react()],
|
integrations: [react()],
|
||||||
|
|
||||||
vite: {
|
vite: {
|
||||||
plugins: [tailwindcss()]
|
plugins: [tailwindcss()]
|
||||||
}
|
},
|
||||||
});
|
|
||||||
|
adapter: cloudflare()
|
||||||
|
});
|
||||||
Generated
+2133
-7
File diff suppressed because it is too large
Load Diff
+7
-3
@@ -7,7 +7,7 @@
|
|||||||
"dev": "astro dev",
|
"dev": "astro dev",
|
||||||
"build": "astro build",
|
"build": "astro build",
|
||||||
"build:external": "node scripts/build-astro-external.mjs",
|
"build:external": "node scripts/build-astro-external.mjs",
|
||||||
"preview": "astro preview",
|
"preview": "npm run build && wrangler dev",
|
||||||
"astro": "astro",
|
"astro": "astro",
|
||||||
"typecheck": "astro check",
|
"typecheck": "astro check",
|
||||||
"storybook": "storybook dev -p 6006",
|
"storybook": "storybook dev -p 6006",
|
||||||
@@ -20,9 +20,12 @@
|
|||||||
"preflight:pages": "npm run lab:build && npm run tracking:check && npm run image:budget && npm run storybook:build",
|
"preflight:pages": "npm run lab:build && npm run tracking:check && npm run image:budget && npm run storybook:build",
|
||||||
"deploy:ftp": "bash scripts/deploy-ovh-ftp.sh dist",
|
"deploy:ftp": "bash scripts/deploy-ovh-ftp.sh dist",
|
||||||
"deploy:web:ftp": "npm run build:external && npm run deploy:ftp",
|
"deploy:web:ftp": "npm run build:external && npm run deploy:ftp",
|
||||||
"deploy:web:sftp": "npm run build:external && bash scripts/deploy-ovh-sftp.sh dist"
|
"deploy:web:sftp": "npm run build:external && bash scripts/deploy-ovh-sftp.sh dist",
|
||||||
|
"deploy": "npm run build && wrangler deploy",
|
||||||
|
"cf-typegen": "wrangler types"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@astrojs/cloudflare": "^12.6.12",
|
||||||
"@astrojs/react": "^4.4.1",
|
"@astrojs/react": "^4.4.1",
|
||||||
"@radix-ui/react-slot": "^1.2.3",
|
"@radix-ui/react-slot": "^1.2.3",
|
||||||
"astro": "^5.13.8",
|
"astro": "^5.13.8",
|
||||||
@@ -42,7 +45,8 @@
|
|||||||
"@storybook/react-vite": "^9.1.5",
|
"@storybook/react-vite": "^9.1.5",
|
||||||
"@tailwindcss/vite": "^4.1.13",
|
"@tailwindcss/vite": "^4.1.13",
|
||||||
"storybook": "^9.1.5",
|
"storybook": "^9.1.5",
|
||||||
"typescript": "^5.9.2"
|
"typescript": "^5.9.2",
|
||||||
|
"wrangler": "^4.70.0"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"@astrojs/language-server": {
|
"@astrojs/language-server": {
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
_worker.js
|
||||||
|
_routes.json
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"main": "dist/_worker.js/index.js",
|
||||||
|
"name": "electron-rare",
|
||||||
|
"compatibility_date": "2025-09-27",
|
||||||
|
"compatibility_flags": [
|
||||||
|
"global_fetch_strictly_public",
|
||||||
|
"nodejs_compat"
|
||||||
|
],
|
||||||
|
"assets": {
|
||||||
|
"binding": "ASSETS",
|
||||||
|
"directory": "dist"
|
||||||
|
},
|
||||||
|
"observability": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"$schema": "node_modules/wrangler/config-schema.json"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user