-
-
Save akoepcke/9e9c204f88391bc2918a37b008c24833 to your computer and use it in GitHub Desktop.
Next.js - Force the creation of an index.html file for every page
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
module.exports = { | |
// forcing the creation of an index.html for every page to allow | |
// providers serving pages without having to add .html to the url | |
exportPathMap: async function (defaultPathMap) { | |
const pathMap = {}; | |
for (const [path, config] of Object.entries(defaultPathMap)) { | |
if (path === "/") { | |
pathMap[path] = config; | |
} else { | |
pathMap[`${path}/index`] = config; | |
} | |
} | |
return pathMap; | |
}, | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment