Skip to content

Commit

Permalink
refactor: remove always truthy flag
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Apr 15, 2024
1 parent 2bd27e7 commit 8680d2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion packages/next/src/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,6 @@ export default async function getBaseWebpackConfig(
buildId,
rewrites,
isDevFallback,
exportRuntime: true,
appDirEnabled: hasAppDir,
}),
new ProfilingPlugin({ runWebpackSpan, rootDir: dir }),
Expand Down
12 changes: 3 additions & 9 deletions packages/next/src/build/webpack/plugins/build-manifest-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,12 @@ export default class BuildManifestPlugin {
private buildId: string
private rewrites: CustomRoutes['rewrites']
private isDevFallback: boolean
private exportRuntime: boolean
private appDirEnabled: boolean

constructor(options: {
buildId: string
rewrites: CustomRoutes['rewrites']
isDevFallback?: boolean
exportRuntime?: boolean
appDirEnabled: boolean
}) {
this.buildId = options.buildId
Expand All @@ -144,7 +142,6 @@ export default class BuildManifestPlugin {
this.rewrites.beforeFiles = options.rewrites.beforeFiles.map(processRoute)
this.rewrites.afterFiles = options.rewrites.afterFiles.map(processRoute)
this.rewrites.fallback = options.rewrites.fallback.map(processRoute)
this.exportRuntime = !!options.exportRuntime
}

createAssets(compiler: any, compilation: any, assets: any) {
Expand Down Expand Up @@ -258,12 +255,9 @@ export default class BuildManifestPlugin {
JSON.stringify(assetMap, null, 2)
)

if (this.exportRuntime) {
assets[`server/${MIDDLEWARE_BUILD_MANIFEST}.js`] =
new sources.RawSource(
`self.__BUILD_MANIFEST=${JSON.stringify(assetMap)}`
)
}
assets[`server/${MIDDLEWARE_BUILD_MANIFEST}.js`] = new sources.RawSource(
`self.__BUILD_MANIFEST=${JSON.stringify(assetMap)}`
)

if (!this.isDevFallback) {
const clientManifestPath = `${CLIENT_STATIC_FILES_PATH}/${this.buildId}/_buildManifest.js`
Expand Down

0 comments on commit 8680d2a

Please sign in to comment.