Skip to content

Commit

Permalink
server doesn't need to be contenthashing at all (#25251)
Browse files Browse the repository at this point in the history
contenthashing is not useful for the server

cc @ijjk
  • Loading branch information
sokra authored May 19, 2021
1 parent 9513572 commit 96f9945
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ export default async function getBaseWebpackConfig(
splitChunks: isServer
? isWebpack5
? ({
filename: `${dev ? '[name]' : '[name].[contenthash]'}.js`,
filename: '[name].js',
// allow to split entrypoints
chunks: 'all',
// size of files is not so relevant for server build
Expand Down Expand Up @@ -931,7 +931,7 @@ export default async function getBaseWebpackConfig(
: 'static/webpack/[hash].hot-update.json',
// This saves chunks with the name given via `import()`
chunkFilename: isServer
? `${dev ? '[name]' : '[name].[contenthash]'}.js`
? '[name].js'
: `static/chunks/${isDevFallback ? 'fallback/' : ''}${
dev ? '[name]' : '[name].[contenthash]'
}.js`,
Expand Down
2 changes: 1 addition & 1 deletion test/integration/build-output/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe('Build Output', () => {
expect(parseFloat(err404Size)).toBeCloseTo(gz ? 3.06 : 8.15, 1)
expect(err404Size.endsWith('kB')).toBe(true)

expect(parseFloat(err404FirstLoad)).toBeCloseTo(gz ? 66.5 : 203, 1)
expect(parseFloat(err404FirstLoad)).toBeCloseTo(gz ? 66.4 : 203, 1)
expect(err404FirstLoad.endsWith('kB')).toBe(true)

expect(parseFloat(sharedByAll)).toBeCloseTo(gz ? 63.4 : 195, 1)
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2383,11 +2383,6 @@
call-me-maybe "^1.0.1"
glob-to-regexp "^0.3.0"

"@next/eslint-plugin-next@^10.1.3":
version "10.1.3"
resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-10.1.3.tgz#739743aa33aed28d97e670b9f80b84440cf2a3c7"
integrity sha512-KrZUb6cHXt/rPhN9bSrlVLAq+9LyNOWurqbrUww3OXmrFlXBDI8W6Z0ToDkQMkIH6gTtmpGbuctxCkQ2pgeXzQ==

"@nodelib/[email protected]":
version "2.1.3"
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b"
Expand Down

0 comments on commit 96f9945

Please sign in to comment.