dai-shi / waku

⛩ī¸ The minimal React framework
https://waku.gg
MIT License
3.91k stars 102 forks source link

expose build function for more customization #681

Closed nihgwu closed 2 weeks ago

nihgwu commented 2 weeks ago

I see right now config file is hardcoded as waku.config.ts, I think we can support --config to set it via CLI and move all output options like --with-vercel to output: 'vercel' | 'netlify' ..., as those are only used in build, doesn't make sense to have it globally

dai-shi commented 2 weeks ago

Yeah, there's some room for improvements. Originally, we didn't have waku.config.ts, so there's some historical thing. Stay tuned.

We generally don't want to use config file for normal users. So, we may still prefer output options.

dai-shi commented 2 weeks ago

I wonder if you prefer specifying config file name or stringified config object directly.

nihgwu commented 2 weeks ago

config file, there is a lib to do the job for you, to support all kinds of file types and even via package.json, and use js/ts if you need middleware

for cli user, I think we can rename --with-vercel to --target=vercel for easier maintenance

nihgwu commented 2 weeks ago

actually for me I can do without config file if we expose low level build method where I can set config directly 😄

dai-shi commented 2 weeks ago

actually for me I can do without config file if we expose low level build method where I can set config directly 😄

Yeah, that's more customizable and aligns far better with my mental model. Actually, we used to expose build function. We can surely do it, maybe with unstable_ prefix. I'll work on it.