mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-28 17:39:57 +02:00
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
This commit is contained in:
committed by
Ian Storm Taylor
parent
ac21510597
commit
cedc7dc2a5
23
site/next.config.js
Normal file
23
site/next.config.js
Normal file
@@ -0,0 +1,23 @@
|
||||
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