Skip to content

优化选项

¥Optimization Options

  • 类型:object

    ¥Type: object

  • 默认值:{}

    ¥Default: {}

配置打包器的优化功能。

¥Configure optimization features for the bundler.

inlineConst

  • 类型:boolean | { mode?: 'all' | 'smart'; pass?: number }

    ¥Type: boolean | { mode?: 'all' | 'smart'; pass?: number }

  • 默认值:false

    ¥Default: false

  • 路径:optimization.inlineConst

    ¥Path: optimization.inlineConst

在打包过程中内联导入的常量值,而不是保留变量引用。启用后,导入模块的常量值将在其使用位置内联,从而可能减少包大小并通过消除变量查找来提高运行时性能。

¥Inline imported constant values during bundling instead of preserving variable references. When enabled, constant values from imported modules will be inlined at their usage sites, potentially reducing bundle size and improving runtime performance by eliminating variable lookups.