Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessioGr committed Jan 29, 2025
1 parent 9a14747 commit a40bec2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 0 additions & 3 deletions packages/next/src/withPayload.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@ export const withPayload = (nextConfig = {}) => {
if (nextConfig.basePath) {
toReturn.env.NEXT_BASE_PATH = nextConfig.basePath
}
if (nextConfig.assetPrefix) {
toReturn.env.NEXT_ASSET_PREFIX = nextConfig.assetPrefix
}

return toReturn
}
Expand Down
4 changes: 3 additions & 1 deletion packages/payload/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,9 @@ export const getPayload = async (
const port = process.env.PORT || '3000'

const path = '/_next/webpack-hmr'
const prefix = process.env.NEXT_BASE_PATH ?? process.env.NEXT_ASSET_PREFIX ?? ''
// The __NEXT_ASSET_PREFIX env variable is set for both assetPrefix and basePath (tested in Next.js 15.1.6)
const prefix = process.env.__NEXT_ASSET_PREFIX ?? ''

cached.ws = new WebSocket(
process.env.PAYLOAD_HMR_URL_OVERRIDE ?? `ws://localhost:${port}${prefix}${path}`,
)
Expand Down

0 comments on commit a40bec2

Please sign in to comment.