Unverified Commit 3f730fc7 authored by Pepijn Senders's avatar Pepijn Senders Committed by GitHub

Improve way cache version string is created (#19763)

Nitpicky change, but the version string contained a double `|`, implying that there might be an empty value between `process.env.__NEXT_VERSION` and the environment variables.
parent e6c1aa64
...@@ -1139,15 +1139,15 @@ export default async function getBaseWebpackConfig( ...@@ -1139,15 +1139,15 @@ export default async function getBaseWebpackConfig(
webpackConfig.optimization.usedExports = false webpackConfig.optimization.usedExports = false
} }
const nextPublicVariables = Object.keys(process.env).reduce( const nextPublicVariables = Object.keys(process.env)
(prev: string, key: string) => { .reduce((acc: string[], key: string) => {
if (key.startsWith('NEXT_PUBLIC_')) { if (key.startsWith('NEXT_PUBLIC_')) {
return `${prev}|${key}=${process.env[key]}` return [...acc, `${key}=${process.env[key]}`]
} }
return prev return acc
}, }, [])
'' .join('|')
)
const nextEnvVariables = Object.keys(config.env).reduce( const nextEnvVariables = Object.keys(config.env).reduce(
(prev: string, key: string) => { (prev: string, key: string) => {
return `${prev}|${key}=${config.env[key]}` return `${prev}|${key}=${config.env[key]}`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment