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,