Skip to content

minifier: maintain a model of globals #13067

@KTibow

Description

@KTibow
This is related to parity with this Rollup optimization

I've been messing around with bundling Svelte, and an important learning is that Rollup makes more complex optimizations than you might expect. Some of these optimizations aren't even found in Terser and esbuild, but they'll be needed in OXC if Rolldown is going to compete with Rollup in bundle size.

accessing any known global, like

Array.isArray
Array.prototype.indexOf
Array.from
Array.prototype
Object.keys
Object.defineProperty
Object.getOwnPropertyDescriptor
Object.prototype
Object.getPrototypeOf
structuredClone

and known-pure calls, like

Symbol("x")
new TextEncoder

should minify to 0 bytes.

would need something like Rollup's knownGlobals

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions