From 53d39554daf97c4592f60f01c714e4ee8dc440cd Mon Sep 17 00:00:00 2001 From: DuCanhGH <75556609+DuCanhGH@users.noreply.github.com> Date: Wed, 30 Nov 2022 14:34:13 +0700 Subject: [PATCH] fix: check if nextConfig.webpack is present --- src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 16548140..508e9602 100644 --- a/src/index.ts +++ b/src/index.ts @@ -372,7 +372,9 @@ const withPWAInit = ( ); } } - + if (typeof nextConfig.webpack === "function") { + return nextConfig.webpack(config, options); + } return config; }, } as NextConfig),