-
Notifications
You must be signed in to change notification settings - Fork 27.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds default config if @next/font is a dependency. Warns instead of errors when subsets is missing. [slack ref](https://vercel.slack.com/archives/C03KED0D4N7/p1666226599615489?thread_ts=1666225686.389179&cid=C03KED0D4N7) ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) Co-authored-by: JJ Kasper <[email protected]>
- Loading branch information
Showing
15 changed files
with
99 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
throw new Error('@next/font/google is not correctly configured') | ||
let message = '@next/font/google failed to run or is incorrectly configured.' | ||
if (process.env.NODE_ENV === 'development') { | ||
message += | ||
'\nIf you just installed `@next/font`, please try restarting `next dev` and resaving your file.' | ||
} | ||
|
||
throw new Error(message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
throw new Error('@next/font/local is not correctly configured') | ||
let message = '@next/font/local failed to run or is incorrectly configured.' | ||
if (process.env.NODE_ENV === 'development') { | ||
message += | ||
'\nIf you just installed `@next/font`, please try restarting `next dev` and resaving your file.' | ||
} | ||
|
||
throw new Error(message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import localFont from '@next/font/local' | ||
|
||
export const font1 = localFont({ src: './font1.woff2', variable: '--font-1' }) | ||
export const font2 = localFont({ src: './font2.woff2', variable: '--font-2' }) | ||
export const font2 = localFont({ src: 'font2.woff2', variable: '--font-2' }) | ||
export const font3 = localFont({ | ||
src: './font3.woff2', | ||
weight: '900', | ||
style: 'italic', | ||
}) | ||
export const font4 = localFont({ src: './font4.woff2', weight: '100' }) | ||
export const font5 = localFont({ | ||
src: './font5.woff2', | ||
src: './test/font5.woff2', | ||
style: 'italic', | ||
preload: false, | ||
}) | ||
export const font6 = localFont({ src: './font6.woff2' }) | ||
export const font6 = localFont({ src: 'test/font6.woff2' }) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
module.exports = { | ||
experimental: { | ||
appDir: true, | ||
fontLoaders: [ | ||
{ | ||
loader: '@next/font/local', | ||
}, | ||
], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters