Commit 4bd3849
create-next-app: fix font file corruption when using import alias (#69806)
There's code that uses `glob` to find all template files and replaces
the default import alias with whatever is specified during CNA. This
does so without excluding fonts, and so we're unintentionally corrupting
these `woff` files.
This wasn't a problem in previous versions because we didn't use
`localFont` in the default template, just `Inter`. The files were
technically still being corrupted it just never manifested unless you
went to actually use them.
This is a quick fix to introduce minimal changes but ideally in a
follow-up we should figure out a better solution for replacing aliases,
ie by using an allowlist rather than an exclude list.
h/t to @lubieowoce for the thorough test cases
Fixes #69748
---------
Co-authored-by: Janka Uryga <[email protected]>1 parent 3756801 commit 4bd3849
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
101 | 110 | | |
102 | 111 | | |
103 | 112 | | |
| |||
0 commit comments