Skip to content

Commit

Permalink
removing from terminal places
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekbh committed Nov 18, 2020
1 parent e8218fa commit d290e48
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/next/next-server/lib/head.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function reduceComponents(
.reverse()
.map((c: React.ReactElement<any>, i: number) => {
const key = c.key || i
if (process.env.__NEXT_OPTIMIZE_FONTS && !props.inAmpMode) {
if (process.env.NODE_ENV === 'production' && !props.inAmpMode) {
if (
c.type === 'link' &&
c.props['href'] &&
Expand Down
8 changes: 1 addition & 7 deletions packages/next/next-server/lib/post-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,7 @@ function sourceIsSupportedType(imgSrc: string): boolean {
}

// Initialization
registerPostProcessor(
'Inline-Fonts',
new FontOptimizerMiddleware(),
// Using process.env because passing Experimental flag through loader is not possible.
// @ts-ignore
(options) => options.optimizeFonts || process.env.__NEXT_OPTIMIZE_FONTS
)
registerPostProcessor('Inline-Fonts', new FontOptimizerMiddleware(), () => true)

registerPostProcessor(
'Preload Images',
Expand Down
2 changes: 1 addition & 1 deletion packages/next/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ export class Head extends Component<
href={canonicalBase + getAmpPath(ampPath, dangerousAsPath)}
/>
)}
{process.env.__NEXT_OPTIMIZE_FONTS
{process.env.NODE_ENV === 'production'
? this.makeStylesheetInert(this.getCssLinks(files))
: this.getCssLinks(files)}
<noscript data-n-css={this.props.nonce ?? ''} />
Expand Down

0 comments on commit d290e48

Please sign in to comment.