File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,7 @@ const defaultConfig: NextConfig = {
2727 assetPrefix : '' ,
2828 configOrigin : 'default' ,
2929 useFileSystemPublicRoutes : true ,
30- generateBuildId : ( ) => {
31- // nanoid is a small url-safe uuid generator
32- const nanoid = require ( 'nanoid' )
33- return nanoid ( )
34- } ,
30+ generateBuildId : ( ) => null ,
3531 generateEtags : true ,
3632 pageExtensions : [ 'jsx' , 'js' ]
3733}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { join } from 'path'
22import promisify from '../lib/promisify'
33import fs from 'fs'
44import webpack from 'webpack'
5+ import nanoid from 'nanoid'
56import loadConfig from 'next-server/next-config'
67import { PHASE_PRODUCTION_BUILD , BUILD_ID_FILE } from 'next-server/constants'
78import getBaseWebpackConfig from './webpack'
@@ -11,9 +12,14 @@ const writeFile = promisify(fs.writeFile)
1112
1213export default async function build ( dir , conf = null ) {
1314 const config = loadConfig ( PHASE_PRODUCTION_BUILD , dir , conf )
14- const buildId = await config . generateBuildId ( ) // defaults to a uuid
1515 const distDir = join ( dir , config . distDir )
1616
17+ let buildId = await config . generateBuildId ( ) // defaults to a uuid
18+ if ( buildId == null ) {
19+ // nanoid is a small url-safe uuid generator
20+ buildId = nanoid ( )
21+ }
22+
1723 try {
1824 await access ( dir , ( fs . constants || fs ) . W_OK )
1925 } catch ( err ) {
You can’t perform that action at this time.
0 commit comments