keystone
keystone copied to clipboard
Custom next.config.js support for admin-ui
If /.keystone/admin/../../next.config.js exists, it will get merged into keystone's admin-ui's NextJS config at runtime.
Maybe it would be only write to .keystone/admin/next.config.js if something like config.ui.writeNextConfig !== false? Or similar?
Users can then do whatever they want?
when #9186 is merged, user should be able to do this
OK, this pull request is superseded by #9186
Actually @gautamsi, #9186 is a breaking change, maybe we can land this earlier?
@dcousens do you plan to have any patch/minor release soon? I might make use of that if it comes before end of this month.
Yes, but I don't have time to test this particular pull request before then - can you?
sure, I can help regularly, do you want to create a label for me which I can keep eye on? I mean create a label like 'pr help wanted' and i can jump in, I usually do not miss any PR from my GitHub notification except occassionally.
Or maybe just assign to me and I can revert back with my finding on specific PR.
I tried testing this, I had to install lodash as dependency which is missing in PR.
I see that there is workaround available to allow using a custom nextjs config. Instead of releasing this I would wait for #9186
this is how to achieve same thing without needing this PR.
- extend the base config generated by keystone. you can run
keystone devonce to generate one. Copy the content of.keystone/admin/next.config.jsto custom next.config.js file (it can be named anything) - extend your config
- use following code snippet of
keystone.tsto overwrite the generated next.config.js
export default config({
// ....other config
ui: {
getAdditionalFiles: [
() => [{ mode: 'copy', inputPath: path.resolve('next.config.js'), outputPath: 'next.config.js' }]
],
}
})