Unverified Commit 4d04a82d authored by LongYinan's avatar LongYinan Committed by GitHub

Add skipEntries option to turbotrace (#45410)

In some apps like `vercel/site`; tracing the entries is unnecessary but
is really time/memory consuming. In this case, we should expose an
option to disable tracing the entries.

Closes WEB-523
Co-authored-by: 's avatarkodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
parent 1248f6ff
...@@ -106,6 +106,10 @@ module.exports = { ...@@ -106,6 +106,10 @@ module.exports = {
maxFiles?: number maxFiles?: number
// control the maximum memory usage of the `turbotrace`, in `MB` // control the maximum memory usage of the `turbotrace`, in `MB`
memoryLimit?: number memoryLimit?: number
// control if the webpack entries should be skipped when tracing
// tracing the entries is not necessary for applications that all assets could be traced in the dist files
// default is `false`
skipEntries?: boolean
}, },
}, },
} }
......
...@@ -184,7 +184,7 @@ export class TraceEntryPointsPlugin implements webpack.WebpackPluginInstance { ...@@ -184,7 +184,7 @@ export class TraceEntryPointsPlugin implements webpack.WebpackPluginInstance {
} }
// startTrace existed and callable // startTrace existed and callable
if (this.turbotrace) { if (this.turbotrace && !this.turbotrace.skipEntries) {
let binding = (await loadBindings()) as any let binding = (await loadBindings()) as any
if ( if (
!binding?.isWasm && !binding?.isWasm &&
......
...@@ -478,6 +478,9 @@ const configSchema = { ...@@ -478,6 +478,9 @@ const configSchema = {
memoryLimit: { memoryLimit: {
type: 'integer', type: 'integer',
}, },
skipEntries: {
type: 'boolean',
},
}, },
}, },
}, },
......
...@@ -176,6 +176,7 @@ export interface ExperimentalConfig { ...@@ -176,6 +176,7 @@ export interface ExperimentalConfig {
processCwd?: string processCwd?: string
maxFiles?: number maxFiles?: number
memoryLimit?: number memoryLimit?: number
skipEntries?: boolean
} }
mdxRs?: boolean mdxRs?: boolean
/** /**
......
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