Installation
Million.js assumes that you have an existing React project. To learn about how to create a React app, please see React's documentation (opens in a new tab).
If you are using a Create React App (CRA) (opens in a new tab) Setup, you will need to configure Craco (opens in a new tab) 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 Million.js
npm install million
Add the compiler to your application
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.