Skip to content

Commit

Permalink
Merge commit '537bf1ed8c6cfdff4ece1c9e5428da443628a9b9' into bugfix/w…
Browse files Browse the repository at this point in the history
…ebpack-out-of-output-path
  • Loading branch information
sokra committed Mar 16, 2021
2 parents 07255ed + 537bf1e commit e3b7074
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1217,22 +1217,6 @@ export default async function getBaseWebpackConfig(
webpackConfig.optimization.usedExports = false
}

const nextPublicVariables = Object.keys(process.env)
.reduce((acc: string[], key: string) => {
if (key.startsWith('NEXT_PUBLIC_')) {
return [...acc, `${key}=${process.env[key]}`]
}
return acc
}, [])
.join('|')

const nextEnvVariables = Object.keys(config.env).reduce(
(prev: string, key: string) => {
return `${prev}|${key}=${config.env[key]}`
},
''
)

const configVars = JSON.stringify({
crossOrigin: config.crossOrigin,
pageExtensions: config.pageExtensions,
Expand All @@ -1257,10 +1241,8 @@ export default async function getBaseWebpackConfig(
type: 'filesystem',
// Includes:
// - Next.js version
// - NEXT_PUBLIC_ variable values (they affect caching) TODO: make this module usage only
// - next.config.js `env` key
// - next.config.js keys that affect compilation
version: `${process.env.__NEXT_VERSION}|${nextPublicVariables}|${nextEnvVariables}|${configVars}`,
version: `${process.env.__NEXT_VERSION}|${configVars}`,
cacheDirectory: path.join(dir, '.next', 'cache', 'webpack'),
}

Expand Down

0 comments on commit e3b7074

Please sign in to comment.