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.
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.
Manual configuration
In the case you want more granular control over the installation process, you can follow the steps below.
Install package
First things first, you'll need to install Million.js. You can do this with your favorite package manager:
npm install million
Use the compiler
Then, add the 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);