Skip to content

Instantly share code, notes, and snippets.

@mdubourg001
Created April 20, 2023 21:38
Show Gist options
  • Save mdubourg001/82851c63721da0bc4869b3a70f3ef62c to your computer and use it in GitHub Desktop.
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
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