Skip to content

Conversation

@coder13
Copy link
Contributor

@coder13 coder13 commented Dec 16, 2025

Summary

Fix issue with prod fonts trying to be loaded in development.

image

This issue is fixed by loading a different font via the nextjs webpack config.

webpack(config) {
if (!process.env.PROPRIETARY_FONT) {
config.resolve.alias["@/styles/fonts"] =
require("path").resolve(__dirname, "src/styles/fonts/empty-font.ts");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is not possible to do via import?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you referring specifically to require("path"). I hadn't thought of it, yeah should be able to change to import I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, please use the import then. We should only be using require if it's needed for a commonjs module as per @typescript-eslint/no-require-imports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants