Allow specifying publish directory outside of base

Is your feature request related to a problem? Please describe.

We have NX monorepo and multiple apps in there. We’d like to deploy some of them to Netlify, but it’s unclear how can we use file based configuration per site as when I add base dir while linking the site it forces me to put the dist separately in each site as it prepends the path to publish dir with base. However we have a regular NX dist structure where dist dir is in root and within it we have different directories per site. It’s much more convenient to use for us. Why does netlify not allow this? I managed to still connect Netlify to it without providing base, but now it doesn’t pick up settings from site’s netlify.toml and we can’t use plugins, edge functions, rewrites, etc.

Describe the solution you’d like

Allow specifying publish directory outside of base. E.g. if our site is in frontend/website we’d like to be able to specify publish from dist/website.

Or better yet, when importing site from git provider, Netlify should give us an option to provide a path to netlify.toml insead of manually specifying base, build script and publish as we already have that info in the config file.

Describe alternatives you’ve considered

Restructuring our monorepo is suboptimal to us. I’d rather have us drop Netlify than deal wit this.
It seems it’s possible to rewrite the root netlify.toml within the pipeline, but we don’t consider it maintainable, it’s not worth putting effort into IMHO.

Hi, @BlindDespair. On most Unix systems (the build system is Linux) you can use ../ to say “up one directory level”.

I believe this is the directory structure you described:

$ tree .
├── dist
│   └── website
└── frontend
    └── website

So, if you base directory is frontend/website, the the publish directory would be frontend/website/../../dist/website.

This syntax does work and makes it possible to use a publish directory which is itself not a subdirectory of the base directory.

Would you please let us know if that solution will work for you? If not, would you please let us know what it is about the solution which doesn’t meet your requirements?