Create Cpp.js Applications
Note: Make sure you have completed the Cpp.js - Prerequisites instructions.
npm init cpp.js@latest
This command will install and execute create-cpp.js, the official Cpp.js project scaffolding tool. You will be presented with prompts for several optional features such as React.
Welcome to Cpp.js!
✔ Project Name … <your-project-name>
✔ Where should we create your project?
(leave blank to use current directory) … <your-project-name>
✔ Select a type: › Web
✔ Select a framework: › React
✔ Select a bundler: › Vite
Your project is ready!
If you are unsure about an option, simply choose Web, React and Vite. Once the project is created, follow the instructions to install dependencies and start the dev server:
cd <your-project-name>
npm install
npm run dev
You should now have your first Cpp.js project running!
When you are ready to ship your app to production, run the following:
npm run build
This will create a production-ready build of your app in the project's ./dist directory.