Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom next.config.js support for admin-ui #9105

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ggpwnkthx
Copy link
Contributor

@ggpwnkthx ggpwnkthx commented Apr 19, 2024

If /.keystone/admin/../../next.config.js exists, it will get merged into keystone's admin-ui's NextJS config at runtime.

@dcousens
Copy link
Member

dcousens commented Jul 17, 2024

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?

@gautamsi
Copy link
Member

when #9186 is merged, user should be able to do this

@dcousens
Copy link
Member

OK, this pull request is superseded by #9186

@dcousens dcousens closed this Jul 18, 2024
@dcousens
Copy link
Member

Actually @gautamsi, #9186 is a breaking change, maybe we can land this earlier?

@dcousens dcousens reopened this Jul 18, 2024
@gautamsi
Copy link
Member

@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.

@dcousens dcousens changed the title custom next.config.js support for admin-ui Custom next.config.js support for admin-ui Jul 25, 2024
@dcousens
Copy link
Member

Yes, but I don't have time to test this particular pull request before then - can you?

@gautamsi
Copy link
Member

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.

@gautamsi
Copy link
Member

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.

  1. extend the base config generated by keystone. you can run keystone dev once to generate one. Copy the content of .keystone/admin/next.config.js to custom next.config.js file (it can be named anything)
  2. extend your config
  3. use following code snippet of keystone.ts to 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' }]
    ],
  }
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants