Creating a New Web Project
tip
You can also start from existing Web projects
Modern Web Project Essentials
To build a brand-new WebSpatial project from scratch, first create a modern Web project (currently React-only) that meets the following requirements:
- Use HTML APIs (for example, JSX) through a UI framework such as React
- Use CSS APIs through the same UI framework (supports PostCSS, TailwindCSS, CSS-in-JS, and other approaches)
- Manage project dependencies with npm or any npm-compatible package manager (like pnpm)
- Compile and build HTML and static web assets (JS, CSS, images, etc.) that run directly in desktop / mobile browsers
- Run a Web server that exposes URLs accessible from desktop / mobile browsers
Project Templates for Getting Started
Below are several options for creating a modern Web project that satisfies the requirements above. Any of these can serve as the starting point before you add the WebSpatial SDK.
note
Ensure Node.js is installed first. See the official Node.js site for installation instructions.
-
React + Vite
- npm
- pnpm
- Yarn
npx create-vite --template react
pnpm dlx create-vite --template react
yarn dlx create-vite --template react
-
React + Vite + TypeScript
- npm
- pnpm
- Yarn
npx create-vite --template react-ts
pnpm dlx create-vite --template react-ts
yarn dlx create-vite --template react-ts
-
React + Next.js
- npm
- pnpm
- Yarn
npx create-next-app --js
pnpm dlx create-next-app --js
yarn dlx create-next-app --js
-
React + Next.js + TypeScript
- npm
- pnpm
- Yarn
npx create-next-app --ts
pnpm dlx create-next-app --ts
yarn dlx create-next-app --ts
-
React + Rsbuild
- npm
- pnpm
- Yarn
npx create-rsbuild --template react
pnpm dlx create-rsbuild --template react
yarn dlx create-rsbuild --template react
-
React + Rsbuild + TypeScript
- npm
- pnpm
- Yarn
npx create-rsbuild --template react-ts
pnpm dlx create-rsbuild --template react-ts
yarn dlx create-rsbuild --template react-ts
-
React + Rspack
- npm
- pnpm
- Yarn
npx create-rspack --template react
pnpm dlx create-rspack --template react
yarn dlx create-rspack --template react
-
React + Rspack + TypeScript
- npm
- pnpm
- Yarn
npx create-rspack --template react-ts
pnpm dlx create-rspack --template react-ts
yarn dlx create-rspack --template react-ts