[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live)

[Help](/c/help/9)

# May I point Prod and Dev to different folders from the same repo?

153 views · 1 like · 4 posts


42piratas (@42piratas) · 2024-08-03

E.g. I'd like to have my Prod domain linked to my `gh-repo/coming-soon/` folder and my Dev domain (preview) linked to `gh-repo/preview/`. Is this possible?


Pauline P. Narvas (@pawlean) · 2024-08-05

Hello, and welcome, @42piratas!

Yes, you can point your production and development deployments to different folders in the same GitHub repository on Vercel with a `vercel.json` file in the root of your repository.

Something like this setup will allow Vercel to recognize that it should use different build configurations based on the specified folders.

```
{
  "builds": [
    {
      "src": "coming-soon/package.json",
      "use": "@vercel/node"
    },
    {
      "src": "preview/package.json",
      "use": "@vercel/node"
    }
  ]
}

```
To deploy different folders for production and development environments, you also need to configure your project settings on Vercel to use different branches or set up custom build commands.

You'll need to configure your Vercel Project settings. from your Vercel project dashboard, go to **Settings > Git** and set the **Production Branch** to `main`.

![CleanShot 2024-08-05 at 12.48.36@2x|690x309](upload://ctRVltUbsecbKIsueRTfRjbHCDk.png)

Make sure that your development branch (e.g., `dev`) is used for preview deployments.

 In **Settings > Build & Development Settings**, specify custom build commands for each environment.

![CleanShot 2024-08-05 at 12.50.08@2x|690x419](upload://cYhZRNmkTjEEy6aliPGD6yr3S3w.png)

For example:

**Production Build Command**:
```
cd coming-soon && npm install && npm run build
```

**Preview Build Command**:
```
cd preview && npm install && npm run build
```

For detailed steps and examples, refer to [relevant documentation](https://vercel.com/docs/project-configuration).


42piratas (@42piratas) · 2024-08-05 · ♥ 1

Thank you very much for you help! I really appreciate it! 🙏🏽


Pauline P. Narvas (@pawlean) · 2024-08-05

You're welcome, @42piratas!

Feel free to drop by https://community.vercel.com/t/introductions/157 by the way. Would love to hear more about what you're building! 

Thanks for being part of the community. :smile: