Erwin
01/20/2022, 1:34 AMvelvetbaldmime
01/20/2022, 7:26 AM/.dist.sh
2. Running ./dist.sh
produces the following structure:
- ./site
- ./site/functions/....js
- ./site/...html
And I would like to deploy ./site
to Pages.
I tried to change the root - but then the ./dist.sh
is not accessible, may be I should put dist.sh
into ./site
and just not clean that folder before generation
But it seems wonkyCоlе
01/20/2022, 8:12 AM./dist.sh
?velvetbaldmime
01/20/2022, 8:13 AM./dist.sh
into the "Build command" of a Pages projectvelvetbaldmime
01/20/2022, 8:13 AMCоlе
01/20/2022, 8:13 AMvelvetbaldmime
01/20/2022, 8:14 AMvelvetbaldmime
01/20/2022, 8:14 AMCоlе
01/20/2022, 8:15 AMCоlе
01/20/2022, 8:16 AMCоlе
01/20/2022, 8:17 AMnpm run build
as node build.mjs
which just runs my js fileCоlе
01/20/2022, 8:17 AM.sh
Cоlе
01/20/2022, 8:18 AMvelvetbaldmime
01/20/2022, 8:18 AMCоlе
01/20/2022, 8:18 AMCоlе
01/20/2022, 8:18 AMCоlе
01/20/2022, 8:18 AMCоlе
01/20/2022, 8:19 AMCоlе
01/20/2022, 8:19 AMCоlе
01/20/2022, 8:19 AMvelvetbaldmime
01/20/2022, 8:20 AMmain
2. Check them in into an orphan branch cloudflare
under /functions
subfolder
3. and I have Cloudflare Pages setup to work off of cloudflare
branch, not main
Which works for my purposes, but I miss all the preview environment and PR goodnessvelvetbaldmime
01/20/2022, 8:20 AMCоlе
01/20/2022, 8:20 AMCоlе
01/20/2022, 8:21 AMnpm run something
, 99% chance it'll build on pages/workersCоlе
01/20/2022, 8:21 AMCоlе
01/20/2022, 8:22 AMnpm
command, you're most likely a-okCоlе
01/20/2022, 8:23 AMCоlе
01/20/2022, 8:25 AMjs
"scripts": {
"build": "node src/gendoc.mjs"
},
by running npm run build
I'm just executing a script. You could probably do the exact same thing with a .sh
fileCоlе
01/20/2022, 8:25 AM"build": "./dist.sh"
maybe?velvetbaldmime
01/20/2022, 8:26 AMfunctions
folder that was generated by the script
May be I messed it up somehow.
That's really the only part that didn't work - dynamically generated functions as part of ./dist.sh
The rest worked a-ok
I'll see if running it as part of the NPM build makes a difference, thank you 🙏
The problem is most likely in the chair, not the computer..