Cloudflare Pages
Deploy your Thulite project on Cloudflare Pages, a JAMstack platform for building and shipping frontend sites.
Prerequisites
To get started, you need:
- A Cloudflare account. If you do not already have one, you can create a free account during setup.
- Your app code pushed to a GitHub or GitLab repository.
Deploy with Git
- Set up a new project on Cloudflare Pages.
- Push your code to your Git repository (GitHub or GitLab).
- Log in to the Cloudflare dashboard, then select your account in Account Home > Pages.
- Select Create a new project, then choose Connect Git.
- Select the Git project you want to deploy, then click Begin setup.
Use the following build settings:
- Framework preset:
exit 0 - Build command:
npm run build - Build output directory:
public
- Framework preset:
- Click the Save and Deploy button.
Deploy with Wrangler
Install the Wrangler CLI in your project:
Authorize Wrangler with your Cloudflare account using OAuth:
wrangler loginRun your build command:
Deploy the build output directory to Cloudflare Pages:
wrangler pages deploy public
After Wrangler uploads your assets, it provides a preview URL so you can inspect your site. You will also see the new project in the Cloudflare Pages dashboard.
Enable local preview with Wrangler
Update the preview script to run wrangler instead of Thulite’s built-in preview command:
"preview": "wrangler pages dev ./public"Troubleshooting
If you run into errors, check whether your local node version (node -v) matches the NODE_VERSION environment variable in Cloudflare Pages settings.