cc: @rob (our master of the deploy)
Hi @bennett First off, to this day I still think Tygra should have been calling the shots. And definitely had a childhood crush on Cheetara. Ok, moving on…
Yes, Redwood was designed for you to be able to deploy without connecting/configuring a database. But we haven’t exactly created that option in the yarn rw build
command, which is what Netlify is using when you deploy. (We definitely need to provide this option, for the record.) So if you’re willing and able, let’s figure this out together.
You should just delete the “api/prisma” directory. But now the API build is going to fail. You can check this locally with yarn rw build
.
Here’s the code behind the build command. The line that’s breaking things is L25 where the Prisma Client is generated automatically. (Oops – what I think we’ll need to modify in the future is adding a flag, e.g. --no-prisma, which will allow Apps to build without the Prisma Client.) For now, take a look at line 31, specifically:
yarn cross-env NODE_ENV=production babel src --out-dir dist
Ignoring the yarn cross-env
part, in your “api/package.json” add the following:
"scripts": {
"build": "NODE_ENV=production babel src --out-dir dist"
}
This should successfully build your API. You can test it with yarn workspace api build
.
I think it might be easiest if you also port the yarn rw build web
command to “web/package.json”. Using L35-36 from the source code, add this:
"scripts": {
"build": "webpack --config ../node_modules/@redwoodjs/core/config/webpack.production.js
}
That should run correctly with the command yarn workspace web build
. Does it?
Assuming both of those are working, you can now run them together using the following command:
yarn workspaces run build
Your next step will be to set up Netlify (or hosting of your choice) to use that command for building the API and Web sides. The “api/dist” folder should be deployed to Netlify Lambdas and “web/dist” to the Netlify CDN.
Do you think that’s enough for you to take it from here and check back in with a progress report?