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: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
LongYinan 2023-02-02 21:28:19 +08:00 committed by GitHub
parent 1248f6fff6
commit 4d04a82d8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 1 deletions

View file

@ -106,6 +106,10 @@ module.exports = {
maxFiles?: number
// control the maximum memory usage of the `turbotrace`, in `MB`
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
},
},
}

View file

@ -184,7 +184,7 @@ export class TraceEntryPointsPlugin implements webpack.WebpackPluginInstance {
}
// startTrace existed and callable
if (this.turbotrace) {
if (this.turbotrace && !this.turbotrace.skipEntries) {
let binding = (await loadBindings()) as any
if (
!binding?.isWasm &&

View file

@ -478,6 +478,9 @@ const configSchema = {
memoryLimit: {
type: 'integer',
},
skipEntries: {
type: 'boolean',
},
},
},
},

View file

@ -176,6 +176,7 @@ export interface ExperimentalConfig {
processCwd?: string
maxFiles?: number
memoryLimit?: number
skipEntries?: boolean
}
mdxRs?: boolean
/**