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

  1. Set up a new project on Cloudflare Pages.
  2. Push your code to your Git repository (GitHub or GitLab).
  3. Log in to the Cloudflare dashboard, then select your account in Account Home > Pages.
  4. Select Create a new project, then choose Connect Git.
  5. Select the Git project you want to deploy, then click Begin setup.
  6. Use the following build settings:

    • Framework preset: exit 0
    • Build command: npm run build
    • Build output directory: public
  7. Click the Save and Deploy button.

Deploy with Wrangler

  1. Install the Wrangler CLI in your project:

  2. Authorize Wrangler with your Cloudflare account using OAuth:

    wrangler login
  3. Run your build command:

  4. 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.