Created
April 20, 2023 21:38
-
-
Save mdubourg001/82851c63721da0bc4869b3a70f3ef62c 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 hidden or 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