Add Cloudflare Workers configuration (#5)
Co-authored-by: cloudflare-workers-and-pages[bot] <73139402+cloudflare-workers-and-pages[bot]@users.noreply.github.com>
This commit was merged in pull request #5.
This commit is contained in:
committed by
GitHub
parent
429520d6c1
commit
d1ac06b636
@@ -32,3 +32,9 @@ artifacts/imagegen/
|
||||
artifacts/qa-test/*/responsive-v12-pass2/
|
||||
artifacts/qa-test/*/deploy-sftp-dryrun.txt
|
||||
.env
|
||||
|
||||
# wrangler files
|
||||
.wrangler
|
||||
.dev.vars*
|
||||
!.dev.vars.example
|
||||
!.env.example
|
||||
|
||||
+4
-2
@@ -3,6 +3,8 @@ import { defineConfig } from 'astro/config';
|
||||
import react from '@astrojs/react';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
|
||||
import cloudflare from "@astrojs/cloudflare";
|
||||
|
||||
const normalizeUrl = (value) => (value.endsWith('/') ? value : `${value}/`);
|
||||
const rawSiteUrl = process.env.PUBLIC_SITE_URL || process.env.EXTERNAL_SITE_URL || 'https://electron-rare.github.io/';
|
||||
const siteUrl = normalizeUrl(rawSiteUrl);
|
||||
@@ -13,9 +15,9 @@ export default defineConfig({
|
||||
site: siteUrl,
|
||||
base: basePath,
|
||||
output: 'server',
|
||||
adapter: node({ mode: 'standalone' }),
|
||||
adapter: cloudflare(),
|
||||
integrations: [react()],
|
||||
vite: {
|
||||
plugins: [tailwindcss()]
|
||||
}
|
||||
});
|
||||
});
|
||||
Generated
+1591
-5
File diff suppressed because it is too large
Load Diff
+7
-3
@@ -7,7 +7,7 @@
|
||||
"dev": "astro dev",
|
||||
"build": "astro build",
|
||||
"build:external": "node scripts/build-astro-external.mjs",
|
||||
"preview": "astro preview",
|
||||
"preview": "npm run build && wrangler dev",
|
||||
"astro": "astro",
|
||||
"typecheck": "astro check",
|
||||
"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",
|
||||
"deploy:ftp": "bash scripts/deploy-ovh-ftp.sh dist",
|
||||
"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": {
|
||||
"@astrojs/cloudflare": "12",
|
||||
"@astrojs/node": "^9.4.5",
|
||||
"@astrojs/react": "^4.4.1",
|
||||
"@radix-ui/react-slot": "^1.2.3",
|
||||
@@ -48,7 +51,8 @@
|
||||
"@storybook/react-vite": "^9.1.5",
|
||||
"@tailwindcss/vite": "^4.1.13",
|
||||
"storybook": "^9.1.5",
|
||||
"typescript": "^5.9.2"
|
||||
"typescript": "^5.9.2",
|
||||
"wrangler": "^4.86.0"
|
||||
},
|
||||
"overrides": {
|
||||
"@astrojs/language-server": {
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
_worker.js
|
||||
_routes.json
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"$schema": "node_modules/wrangler/config-schema.json",
|
||||
"name": "electron-rare",
|
||||
"compatibility_date": "2026-04-28",
|
||||
"observability": {
|
||||
"enabled": true
|
||||
},
|
||||
"main": "dist/_worker.js/index.js",
|
||||
"compatibility_flags": [
|
||||
"global_fetch_strictly_public",
|
||||
"nodejs_compat"
|
||||
],
|
||||
"assets": {
|
||||
"binding": "ASSETS",
|
||||
"directory": "dist"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user