Skip to content

fix: replacing --cmd with && in custom build commands #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions npm-packages/docs/docs/production/hosting/vercel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ follow the [Convex React Quickstart](/quickstart/react.mdx) first. Then:
</Step>
<Step title="Override the Build command">
Override the "Build command" to be
`npx convex deploy --cmd 'npm run build'`.
`npx convex deploy && npm run build`.

If your project lives in a subdirectory of your repository you'll
also need to change _Root Directory_ above accordingly.
Expand Down Expand Up @@ -75,7 +75,7 @@ functions and publish your site changes.
### How it works

In Vercel, we overrode the _Build Command_ to be
`npx convex deploy --cmd 'npm run build'`.
`npx convex deploy && npm run build`.

`npx convex deploy` will read `CONVEX_DEPLOY_KEY` from the environment and use
it to set the `CONVEX_URL` (or similarly named) environment variable to point to
Expand All @@ -95,7 +95,7 @@ You can use `--cmd-url-env-var-name` to customize the variable name used by your
frontend code if the `deploy` command cannot infer it, like

```sh
npx convex deploy --cmd-url-env-var-name CUSTOM_CONVEX_URL --cmd 'npm run build'
npx convex deploy --cmd-url-env-var-name CUSTOM_CONVEX_URL && npm run build
```

### Authentication
Expand Down Expand Up @@ -148,7 +148,7 @@ This assumes you have already followed the steps in
when deploying to production.

```sh title="Vercel > Settings > Build & Development settings > Build Command"
npx convex deploy --cmd 'npm run build' --preview-run 'functionName'
npx convex deploy && npm run build --preview-run 'functionName'
```

</Step>
Expand Down