1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-01-19 14:27:07 +01:00
slate/site/next.config.js
Irwan Fario Subastian cedc7dc2a5 lint & example fixes (#3160)
* fix import extensions of eslint

* revert next.config.cjs

* fix eslint globbing

* add migrating to docs’ sidebar

* fix prettier error on Contributing.md

* put quotes for glob matching for windows user

* remove type: module from  package.json
2019-11-29 00:16:39 -05:00

24 lines
526 B
JavaScript

const fs = require('fs')
const path = require('path')
module.exports = {
exportPathMap: async (defaultPathMap, config) => {
const { dir } = config
const examples = fs.readdirSync(path.resolve(dir, 'examples'))
const pages = {
'/': { page: '/' },
}
for (const file of examples) {
if (!file.endsWith('.js')) {
continue
}
const example = file.replace('.js', '')
pages[`/examples/${example}`] = { page: '/examples/[example]', example }
}
return pages
},
}