Conditional asset inclusion based on build configuration #63495
davetapley
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
When doing
next build
(akaoutput: "export"
), I would like to only include assets inpublic/
(or similar) which are required, based on an env var.Non-Goals
Server side rendering
Background
My current setup works like this:
I have a
sites.json
which defines different 'sites' for different 'domains'.Then I can pass the domain in as an env var which populates a
generateStaticParams
, loosely like this:It works great but for one issue: Everything I put in
public/
is written toout/
regardless of thedomain
env var.That makes sense, but I can't think of a way to have only the required files written.
Proposal
Not sure, but happy to contribute 🤪
Beta Was this translation helpful? Give feedback.
All reactions