I tried to deploy my Angular project from my Github repository with Cloudflare free plan.
But failed. How can I success deploy?
About project:
The project doesn’t include SSR or SSG.
I added .nvmrc to project.
Build settings on cloudflare is default:
Build command:
npm run build
Build output directory:
/dist/cloudflare
Build system version:
2 (latest)
Root directory:
/
Environment variables:
None
This is last part of build log:
11:57:04.079 Finished
11:57:04.079 Note: No functions dir at /functions found. Skipping.
11:57:04.080 Validating asset output directory
11:57:04.080 Error: Output directory “dist/cloudflare” not found.
11:57:05.266 Failed: build output directory not found
Thank you. After I added folder, it was deployed successfully. But site returns 404. There is still a probrem.
By the way, the strange thing is default build directory when select Angular, dist/cloudflare.https://developers.cloudflare.com/pages/framework-guides/deploy-an-angular-site/ When you generated Angular project by ng new, dist is registered in .gitignore. So, if you add dist directory locally, it is not refrected to GitHub. Actually, I had to add directory on GitHub. This is unconfortable. Why is default build directory unconfortable? Anyway document is wrong because deploy fails in spite of following description. It should be fixed. And I have to start another discussion about wrong document.
This includes .nvmrc I added manually and files that were generated by ng new. And it doesn’t include code for SSR and dist directory.
Now I fail to deploy this from GitHub on Cloudflare when I select angular. Settings is in my first post. This is full log:
I can see warning icon on side of “Building application”.
[url](h ttps://angular-dafault.pages.dev/)
h ttps://github.com/sakairy/angular_practice
This doesn’t include SSR but includes some components and other code. Additionally, I added dist/cloudflare on GitHub.
I deployed it on Cloudflare in following condition.
From GitHub
Select Angular
Default Settings
Doploy seems to be succeeded, but I can’t see the site.
[url](h ttps://angular-practice.pages.dev/)