mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-21 06:31:28 +02:00
Nodejs 13 compat and eslint/prettier glob fix (#3149)
This commit is contained in:
committed by
Ian Storm Taylor
parent
6608a5df39
commit
4bbbfba142
@@ -1,23 +0,0 @@
|
||||
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
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user