Skip to content

Commit

Permalink
use CF instead
Browse files Browse the repository at this point in the history
Rishi Raj Jain committed May 10, 2024
1 parent c2f07cf commit 7f35327
Showing 5 changed files with 1,882 additions and 617 deletions.
9 changes: 7 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import vercel from '@astrojs/cloudflare'
import { defineConfig } from 'astro/config'
import vercel from '@astrojs/vercel/static'

export default defineConfig({
output: 'static',
output: 'server',
adapter: vercel(),
vite: {
ssr: {
external: ['node:buffer', 'node:path', 'node:fs', 'node:os', 'node:crypto'],
},
},
})
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -4,15 +4,17 @@
"dev": "astro dev",
"build": "pnpm build:astro-font && astro build",
"build:astro-font": "cd packages/astro-font && pnpm build",
"fmt": "prettier --write '**/*' --ignore-unknown"
"fmt": "prettier --write '**/*' --ignore-unknown",
"preview": "wrangler pages dev ./dist --node-compat"
},
"devDependencies": {
"prettier": "^3.1.1",
"prettier-plugin-astro": "^0.12.2"
},
"dependencies": {
"astro": "latest",
"@astrojs/cloudflare": "^10.2.5",
"@astrojs/vercel": "latest",
"astro": "latest",
"astro-font": "workspace:./packages/astro-font"
}
}
2 changes: 1 addition & 1 deletion packages/astro-font/package.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"license": "MIT",
"type": "module",
"private": false,
"version": "0.0.80",
"version": "0.0.81",
"name": "astro-font",
"types": "index.d.ts",
"exports": {
18 changes: 13 additions & 5 deletions packages/astro-font/utils.ts
Original file line number Diff line number Diff line change
@@ -262,11 +262,19 @@ async function getFallbackFont(fontCollection: Config): Promise<Record<string, s
fontCollection.src.map((i) =>
getFontBuffer(i.path).then((res) => {
if (res) {
fonts.push({
style: i.style,
weight: i.weight?.toString(),
metadata: create(res),
})
try {
const resMetadata = create(res)
fonts.push({
style: i.style,
weight: i.weight?.toString(),
metadata: resMetadata,
})
} catch (e) {
if (fontCollection.verbose) {
console.log(`[astro-font] ▶`)
console.error(e)
}
}
}
}),
),
2,464 changes: 1,857 additions & 607 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

0 comments on commit 7f35327

Please sign in to comment.