Installation
Million.js assumes that you've already initialized a React project. If you haven't, it is recommended you check out react.dev (opens in a new tab) first.
If you have a CRA (Create React App (opens in a new tab)) Setup, you will need to have Craco (opens in a new tab) configured before proceeding
Setup in seconds
The Million.js CLI will automatically install the package and configure your project for you.
npx million@latest
That's it! Your project is now running on Million.js
Million.js is compatible with React 16 and above. If you're using an older version of React, you'll need to upgrade first.
Configure It Yourself
For more control, Million offers customizable options.
Install package
Install Million.js. You can do this with your favorite package manager:
npm install million
Use the compiler
Then, add the Million compiler to your build tool of choice:
Million.js is supported within the /app
("use client" components only) and /pages
import million from 'million/compiler';
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
const millionConfig = {
auto: true,
// if you're using RSC:
// auto: { rsc: true },
}
export default million.next(nextConfig, millionConfig);
Checkout Automatic Mode to learn about the mechanisms behind Automatic mode.