Trigger a build with example wrangler

This commit is contained in:
Nate Kelley 2025-09-05 17:03:25 -06:00
parent d3861d930a
commit 52223a8cfd
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
4 changed files with 62 additions and 2 deletions

3
apps/web/.gitignore vendored
View File

@ -17,4 +17,5 @@ storybook-static
.env.production
.env.staging
.env.dev
.env.local
.env.local
wrangler.jsonc

View File

@ -4,7 +4,7 @@
"type": "module",
"version": "0.0.1",
"scripts": {
"prebuild": "[ \"$SKIP_ENV_CHECK\" = \"true\" ] || tsx scripts/validate-env.ts",
"prebuild": "tsx scripts/validate-env.ts",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build -- --typecheck",
"build:staging": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode staging",
"build:production": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode production -- --typecheck",

View File

@ -13,6 +13,8 @@ const requiredEnv = {
VITE_PUBLIC_URL: process.env.VITE_PUBLIC_URL,
};
console.log('🐓 The app will use this API URL:', process.env.VITE_PUBLIC_API_URL);
// Validate environment variables
const { hasErrors } = validateEnv(requiredEnv);

View File

@ -0,0 +1,57 @@
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "web",
"main": "./.output/server/index.mjs",
"compatibility_date": "2025-09-02", //Happy birthday to Nate 🎉
"compatibility_flags": ["nodejs_compat", "no_nodejs_compat_v2"],
"assets": {
"directory": ".output/public"
},
"observability": {
"enabled": true
},
"env": {
// Development Environment
"dev": {
"name": "web-dev",
"vars": {
// Development-specific variables can be set here
// Or loaded from .env.dev file
}
},
// Staging Environment
"staging": {
"name": "web-staging",
"routes": [
{
"pattern": "staging.buster.so",
"custom_domain": true
}
],
"vars": {
// Staging-specific variables can be set here
// Or loaded from .env.staging file
}
},
// Production Environment
"production": {
"name": "web-production",
"routes": [
// {
// "pattern": "app.buster.so",
// "custom_domain": true
// }
],
"vars": {
// Production-specific variables can be set here
// Or loaded from .env.production file
}
}
}
}