Generated Code Options
- Type:
Partial<GeneratedCodeOptions> - Default: See individual options
Configuration for the generated code output.
Examples
export default {
output: {
generatedCode: {
preset: 'es2015',
symbols: false,
profilerNames: true,
},
},
};symbols
- Type:
boolean - Default:
false - Path:
output.generatedCode.symbols
Whether to use Symbol.toStringTag for namespace objects.
preset
- Type:
'es5' | 'es2015' - Default:
'es2015' - Path:
output.generatedCode.preset
Allows choosing one of the presets while overriding some options. The preset determines the ECMAScript version used for helper code generated by Rolldown.
profilerNames
- Type:
boolean - Default:
false - Path:
output.generatedCode.profilerNames
Whether to add readable names to internal variables for profiling purposes.
Examples
export default {
output: {
generatedCode: {
profilerNames: true,
},
},
};In-depth
When enabled, generated code will use descriptive variable names that correspond to the original module names, making it easier to profile and debug the bundled code. This can be helpful when using browser profiling tools to identify function execution times, as anonymous functions will have descriptive names.
Note
Enabling profilerNames makes the generated output more difficult to minify effectively. For this reason, it should generally be avoided for libraries and production builds.
Only enable this option when you specifically need better profiling support during development or debugging.