Unverified Commit d1e7847a authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

refactor: remove always truthy flag (#64522)

Remove the `this.exportRuntime` flag in build manifest plugin where it's
always true

Closes NEXT-3118
parent f7944026
...@@ -1815,7 +1815,6 @@ export default async function getBaseWebpackConfig( ...@@ -1815,7 +1815,6 @@ export default async function getBaseWebpackConfig(
buildId, buildId,
rewrites, rewrites,
isDevFallback, isDevFallback,
exportRuntime: true,
appDirEnabled: hasAppDir, appDirEnabled: hasAppDir,
}), }),
new ProfilingPlugin({ runWebpackSpan, rootDir: dir }), new ProfilingPlugin({ runWebpackSpan, rootDir: dir }),
......
...@@ -123,14 +123,12 @@ export default class BuildManifestPlugin { ...@@ -123,14 +123,12 @@ export default class BuildManifestPlugin {
private buildId: string private buildId: string
private rewrites: CustomRoutes['rewrites'] private rewrites: CustomRoutes['rewrites']
private isDevFallback: boolean private isDevFallback: boolean
private exportRuntime: boolean
private appDirEnabled: boolean private appDirEnabled: boolean
constructor(options: { constructor(options: {
buildId: string buildId: string
rewrites: CustomRoutes['rewrites'] rewrites: CustomRoutes['rewrites']
isDevFallback?: boolean isDevFallback?: boolean
exportRuntime?: boolean
appDirEnabled: boolean appDirEnabled: boolean
}) { }) {
this.buildId = options.buildId this.buildId = options.buildId
...@@ -144,7 +142,6 @@ export default class BuildManifestPlugin { ...@@ -144,7 +142,6 @@ export default class BuildManifestPlugin {
this.rewrites.beforeFiles = options.rewrites.beforeFiles.map(processRoute) this.rewrites.beforeFiles = options.rewrites.beforeFiles.map(processRoute)
this.rewrites.afterFiles = options.rewrites.afterFiles.map(processRoute) this.rewrites.afterFiles = options.rewrites.afterFiles.map(processRoute)
this.rewrites.fallback = options.rewrites.fallback.map(processRoute) this.rewrites.fallback = options.rewrites.fallback.map(processRoute)
this.exportRuntime = !!options.exportRuntime
} }
createAssets(compiler: any, compilation: any, assets: any) { createAssets(compiler: any, compilation: any, assets: any) {
...@@ -258,12 +255,9 @@ export default class BuildManifestPlugin { ...@@ -258,12 +255,9 @@ export default class BuildManifestPlugin {
JSON.stringify(assetMap, null, 2) JSON.stringify(assetMap, null, 2)
) )
if (this.exportRuntime) { assets[`server/${MIDDLEWARE_BUILD_MANIFEST}.js`] = new sources.RawSource(
assets[`server/${MIDDLEWARE_BUILD_MANIFEST}.js`] = `self.__BUILD_MANIFEST=${JSON.stringify(assetMap)}`
new sources.RawSource( )
`self.__BUILD_MANIFEST=${JSON.stringify(assetMap)}`
)
}
if (!this.isDevFallback) { if (!this.isDevFallback) {
const clientManifestPath = `${CLIENT_STATIC_FILES_PATH}/${this.buildId}/_buildManifest.js` const clientManifestPath = `${CLIENT_STATIC_FILES_PATH}/${this.buildId}/_buildManifest.js`
......
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