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:
parent
1248f6fff6
commit
4d04a82d8f
4 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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 &&
|
||||
|
|
|
@ -478,6 +478,9 @@ const configSchema = {
|
|||
memoryLimit: {
|
||||
type: 'integer',
|
||||
},
|
||||
skipEntries: {
|
||||
type: 'boolean',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -176,6 +176,7 @@ export interface ExperimentalConfig {
|
|||
processCwd?: string
|
||||
maxFiles?: number
|
||||
memoryLimit?: number
|
||||
skipEntries?: boolean
|
||||
}
|
||||
mdxRs?: boolean
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue