Skip to content

Revert "chore: static assets cdn" #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions apps/web/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import webpack from 'webpack'

/** @type {import('next').NextConfig} */
const nextConfig = {
assetPrefix: getAssetPrefix(),
reactStrictMode: false,
env: {
NEXT_PUBLIC_PGLITE_VERSION: await getPackageVersion('@electric-sql/pglite'),
Expand Down Expand Up @@ -86,20 +85,3 @@ async function getPackageVersion(module) {
const packageJson = await getPackageJson(module)
return packageJson.version
}

function getAssetPrefix() {
// If not force enabled, but not production env, disable CDN
if (process.env.FORCE_ASSET_CDN !== '1' && process.env.VERCEL_ENV !== 'production') {
return undefined
}

// Force disable CDN
if (process.env.FORCE_ASSET_CDN === '-1') {
return undefined
}

// @ts-ignore
return `https://frontend-assets.supabase.com/${
process.env.SITE_NAME
}/${process.env.VERCEL_GIT_COMMIT_SHA.substring(0, 12)}`
}
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "npm run build:sw && next dev",
"build": "npm run build:sw && next build && ./../../scripts/upload-static-assets.sh",
"build": "npm run build:sw && next build",
"build:sw": "vite build",
"start": "next start",
"lint": "next lint",
Expand Down
94 changes: 0 additions & 94 deletions scripts/upload-static-assets.sh

This file was deleted.

7 changes: 1 addition & 6 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@
"KV_*",
"SUPABASE_*",
"LOGFLARE_*",
"REDIRECT_LEGACY_DOMAIN",
"AWS_ACCESS_KEY_ID",
"AWS_SECRET_ACCESS_KEY",
"FORCE_ASSET_CDN",
"ASSET_CDN_S3_ENDPOINT",
"SITE_NAME"
"REDIRECT_LEGACY_DOMAIN"
],
"outputs": [".next/**", "!.next/cache/**"],
"cache": true
Expand Down