Skip to content

Commit 54c38a6

Browse files
authored
Turbopack/Webpack Build: Remove dead code (#80938)
## What? `__NEXT_OPTIMIZE_FONTS` doesn't exist anymore, so this is dead code.
1 parent 6c50ead commit 54c38a6

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

packages/next/src/shared/lib/head.tsx

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -137,29 +137,6 @@ function reduceComponents<T extends {} & WithInAmpMode>(
137137
.reverse()
138138
.map((c: React.ReactElement<any>, i: number) => {
139139
const key = c.key || i
140-
if (
141-
process.env.NODE_ENV !== 'development' &&
142-
process.env.__NEXT_OPTIMIZE_FONTS &&
143-
!inAmpMode
144-
) {
145-
if (
146-
c.type === 'link' &&
147-
c.props['href'] &&
148-
// TODO(prateekbh@): Replace this with const from `constants` when the tree shaking works.
149-
['https://fonts.googleapis.com/css', 'https://use.typekit.net/'].some(
150-
(url) => c.props['href'].startsWith(url)
151-
)
152-
) {
153-
const newProps = { ...(c.props || {}) }
154-
newProps['data-href'] = newProps['href']
155-
newProps['href'] = undefined
156-
157-
// Add this attribute to make it easy to identify optimized tags
158-
newProps['data-optimized-fonts'] = true
159-
160-
return React.cloneElement(c, newProps)
161-
}
162-
}
163140
if (process.env.NODE_ENV === 'development') {
164141
// omit JSON-LD structured data snippets from the warning
165142
if (c.type === 'script' && c.props['type'] !== 'application/ld+json') {

0 commit comments

Comments
 (0)