-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Background
Use case is that we want to get Next.js configured for the server-side as follows:
- Ideally mimic something like
assignDefaults
in https://unpkg.com/browse/[email protected]/dist/server/config.js wherein we pass a config object from readingnext.config.js
and get it all fixed up per that function. - Unfortuately, we can't do this because (1)
assignDefaults
is not exported, and (2) we don't want torequire
anything that has Next's webpack stuff involved (forloadConfig
s webpack hooks).
For our current code, we have a pure object (with object values but no arrays), which we can get away with a naive Object.assign()
on, but this lacks:
- Handling arrays, functions, etc.
- Validation, checking, etc.
Like the real assignDefaults
and loadConfig
do in Next.js proper.
Task
- Find some way to get all the Next.js configuration goodness and parity.
Ideas
- Find a third party library
- Build and monkey patch
dist/server/config.js
to a new file that exportsassignDefaults
- At build time inflate the server object using
assignDefaults
and write it out to disk that gets included in the zip bundle.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request