Preferable way to exclude specific route from bundle in multi-tenant app #1923
Unanswered
meanstackmax
asked this question in
Help & Questions
Replies: 1 comment 5 replies
-
I ain't exactly sure what you want to achieve but, indeed, there isn't any built-in functionality for "split deployments".
Feel free to elaborate; at first sight your motivation seems abstract and weird to me. I'd be more inclined to have one app per deployment while sharing code using private packages using a monorepo. I'd be curious to know why you don't go with the more classical monorepo approach. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a multi-tenant (clients) app and I currently searching for a best way to enable specific route for single client, thus the route should be only included into a bundle for the client where the route is available.
I researched a bit on the issue and found couple of options here:
and then use route-function to exclude that route as well (but not sure if it’s used since we’re using client routing) or do that inside the AppRouterWrapper.tsx
2.Simply extract the content of the page into a separate file and load that lazy on demand on condition (then it should be excluded from the bundle) and perform a client redirection to not-found-page inside +page.tsx .
Probably this second approach will require some unified wrapper as well.
I'd be happy if you could advice a good way of achieving this.
UPD: I've resolved this with the following code but wanted to know if there any built-in or cleaner solution:
in conjunction with:
And then excluded the related chunk with
rollupOptions
:Beta Was this translation helpful? Give feedback.
All reactions