'entry' | 'usage' | 'off'
'off'
Control the polyfill injection mode.
Please refer to the Polyfill Mode for more details.
When output.polyfill
is set to 'usage'
, Rsbuild injects polyfills based on the APIs used in each file. This provides optimal bundle size as only needed polyfills are included.
When output.polyfill
is set to 'entry'
, Rsbuild injects polyfills in each entry file. This ensures all polyfills are available but may increase bundle size.
When output.polyfill
is configured as 'off'
, Rsbuild will not inject the polyfills, and developers need to ensure code compatibility themselves.