Docs
Optimizing compiler

This compiler is part of the internal API. Only use if you know what you are doing and are optimizing for performance.

Experimental Compiler

"Compilers [...] are like 95% about convenience features, actually, and 5% about performance [for web environments]" - Fabio Spampinato (author of Voby) (opens in a new tab)

Million.js has an optimizing compiler that can be used to optimize block initialization in optimize mode. Note that this is an experimental feature and may not work with React.

It current supports Vite (opens in a new tab), Webpack (opens in a new tab), Rollup (opens in a new tab), RSPack (opens in a new tab), and ESBuild (opens in a new tab) through unplugin (opens in a new tab).

vite.config.js
import million from 'million/compiler';
import { defineConfig } from 'vite';
 
export default defineConfig({
  plugins: [million.vite({ mode: 'optimize', ignoreFiles: [] })],
});