Skip to content

Commit 6efa5f4

Browse files
authored
chore: fix pdf fonts fetching for local development (#2950) [skip e2e]
1 parent 9d79bbf commit 6efa5f4

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

packages/web/src/javascripts/Components/SuperEditor/Lexical/Utils/PDFExport/FontConfig.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ const FONT_VARIANT_TO_FONT_OPTIONS: Record<FontVariant, { fontWeight: FontWeight
9090
},
9191
}
9292

93-
const FONT_ASSETS_BASE_PATH = 'https://assets.standardnotes.com/fonts'
93+
const FONT_ASSETS_BASE_PATH =
94+
process.env.NODE_ENV === 'development'
95+
? 'http://localhost:3001/assets/fonts'
96+
: 'https://assets.standardnotes.com/fonts'
97+
9498
const FALLBACK_FONT_SOURCE = '/noto-sans/NotoSans-Regular.ttf'
9599

96100
export const FALLBACK_FONT_FAMILY = FontFamily.Helvetica

packages/web/web.webpack.dev.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ module.exports = (env, argv) => {
2929
devMiddleware: {
3030
writeToDisk: argv.writeToDisk,
3131
},
32+
proxy: {
33+
'/assets': {
34+
target: 'https://assets.standardnotes.com',
35+
changeOrigin: true,
36+
secure: false,
37+
pathRewrite: {
38+
'^/assets': '',
39+
},
40+
},
41+
},
3242
},
3343
})
3444
}

0 commit comments

Comments
 (0)