Skip to content

Commit

Permalink
download font on local
Browse files Browse the repository at this point in the history
  • Loading branch information
toyamarinyon committed Oct 22, 2024
1 parent de1af02 commit 6a5ea76
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 6a5ea76

Please sign in to comment.