Skip to content

Instantly share code, notes, and snippets.

@FairyPenguin
Last active December 29, 2023 10:37
Show Gist options
  • Save FairyPenguin/656d7e4780c252cd5d98feb007cd8fac to your computer and use it in GitHub Desktop.
Save FairyPenguin/656d7e4780c252cd5d98feb007cd8fac to your computer and use it in GitHub Desktop.
next js config file
//This is how the fresh next config file looks
/** @type {import('next').NextConfig} */
const nextConfig = {}
module.exports = nextConfig
// -------------------------
/* Now, I want to add multiple configration here
1- A library asks to do that => module.exports = removeImports({});
2- MDX from the nextjs Docs asks for that => module.exports = withMDX(nextConfig)
3- And multiple libraries asks for a diffrent config like that
*/
// Solutions i tried
/* my first thinking approach was as that file is exporting as module.export which means it's a commonjs,
and as far as i know i can do this
module.exports = {
And here add all the exports
};
But failed
OK next, line by line
module.exports = nextConfig
module.exports = lib1
module.exports = lib2
failed
*/
// Of course i checked the docs, but this is not covered
// but here it comes
// https://nextjs.org/docs/app/api-reference/next-config-js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment