DX Split config for node vs browser environment #1954
CallMeLaNN
started this conversation in
Feature Requests & 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.
-
I've been writing my DX about env var and Payload config here #1654 (comment) It is a small thing but the env context cause some confusions I've seen in some issues.
In a bigger picture config env and imported collections supposed to be easier to deal with env.
A: If we were to let config isomorphic/browser friendly like the current config, consider:
E.g. exposing webpack config seems like to give ability to fully customize it but we can't even add webpack plugins in
payload.config.ts
because those are require different env. So if it is just for webpack alias, just provide a way to make alias instead of all webpack config but we can simplify further, see no 2.Adding a comments in generated
payload.config.ts
fromcreate-payload-app
could be helpful but consider an alternative below.B: Consider to split the config based on env like GatsbyJS is using
gatsby-browser.tsx
andgatsby-node.ts
files independently. We can make one of it or another file likegatsby-config.ts
for the common config.Beta Was this translation helpful? Give feedback.
All reactions