Skip to content

Commit

Permalink
Merge pull request #37 from route06inc/font-test
Browse files Browse the repository at this point in the history
Enable local font downloads when meeting the required conditions
  • Loading branch information
toyamarinyon authored Oct 22, 2024
2 parents 7e8f6c2 + 37e6088 commit 66496b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ next-env.d.ts
.env.sentry-build-plugin

# prepare fonts programmatically
app/fonts/index.ts
app/fonts/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"predev": "node prepare-font.js",
"predev": "bun prepare-font.js",
"dev": "SENTRY_SUPPRESS_TURBOPACK_WARNING=1 next dev --turbo",
"prebuild": "node prepare-font.js",
"build": "next build",
Expand Down
6 changes: 4 additions & 2 deletions prepare-font.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ const downloadFile = async (url, destination) => {

(async () => {
if (
process.env.NODE_ENV === "production" &&
process.env.VERCEL_ENV === "production"
// Check if the environment is production or force downloading fonts
(process.env.NODE_ENV === "production" &&
process.env.VERCEL_ENV === "production") ||
process.env.FORCE_DOWNLOAD_FONTS
) {
const BLOB_URL = process.env.BLOB_URL;

Expand Down

0 comments on commit 66496b2

Please sign in to comment.