From c715f1b8e87448e18d544c804b311c9e7af8581d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Born=C3=B6?= Date: Mon, 27 Feb 2023 12:22:49 +0100 Subject: [PATCH] Fix next/font/google config not being used --- packages/next/src/build/webpack/config/blocks/css/index.ts | 4 +++- test/e2e/next-font/app/next.config.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/next/src/build/webpack/config/blocks/css/index.ts b/packages/next/src/build/webpack/config/blocks/css/index.ts index 03efc6d7a0a2c..ed59fa32b3bdc 100644 --- a/packages/next/src/build/webpack/config/blocks/css/index.ts +++ b/packages/next/src/build/webpack/config/blocks/css/index.ts @@ -188,7 +188,9 @@ export const css = curry(async function css( ) const googleLoaderOptions = ctx.experimental?.fontLoaders?.find( - (loaderConfig) => loaderConfig.loader === '@next/font/google' + (loaderConfig) => + loaderConfig.loader === '@next/font/google' || + loaderConfig.loader === 'next/font/google' )?.options ?? {} const fontLoaders: Array<[string | RegExp, string, any?]> = [ [ diff --git a/test/e2e/next-font/app/next.config.js b/test/e2e/next-font/app/next.config.js index 3f4a776b7f409..51b19fbc18002 100644 --- a/test/e2e/next-font/app/next.config.js +++ b/test/e2e/next-font/app/next.config.js @@ -2,7 +2,7 @@ module.exports = { experimental: { fontLoaders: [ { - loader: '@next/font/google', + loader: 'next/font/google', options: { subsets: ['latin'] }, }, ],