Last active
December 29, 2023 10:37
-
-
Save FairyPenguin/656d7e4780c252cd5d98feb007cd8fac to your computer and use it in GitHub Desktop.
next js config file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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