From f73360cf2afe2c1219d29bf2c1e8bacec9848d6c Mon Sep 17 00:00:00 2001 From: Aiji Uejima Date: Sun, 4 Jul 2021 19:28:30 +0900 Subject: [PATCH] fix: default image path --- src/with-split.spec.ts | 2 +- src/with-split.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/with-split.spec.ts b/src/with-split.spec.ts index aa9ff5c..ee50277 100644 --- a/src/with-split.spec.ts +++ b/src/with-split.spec.ts @@ -104,7 +104,7 @@ describe('withSplit', () => { } }) expect(conf.assetPrefix).toEqual('') - expect(conf.images).toEqual({ path: '' }) + expect(conf.images).toEqual({ path: '/_next/image' }) expect(conf.serverRuntimeConfig).toEqual({ splits: { test1: { diff --git a/src/with-split.ts b/src/with-split.ts index 6186bc2..f6db76c 100644 --- a/src/with-split.ts +++ b/src/with-split.ts @@ -42,7 +42,7 @@ export const withSplit = (args: WithSplitArgs): WithSplitResult => { assetPrefix: nextConfig.assetPrefix || (process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : ''), images: { ...nextConfig.images, - path: nextConfig.images?.path || (process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}/_next/image` : '') + path: nextConfig.images?.path || (process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}/_next/image` : '/_next/image') }, serverRuntimeConfig: { ...nextConfig.serverRuntimeConfig,