mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-31 19:01:54 +02:00
docs: convert examples to typescript (#3766)
* docs: convert examples to typescript * docs: convert remaining examples * docs: update next.js * ci: fix lint * docs: fix next.js path * docs: cleanup * update Co-authored-by: wendellhu <wendellhu@tencent.com>
This commit is contained in:
@@ -2,24 +2,6 @@ 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
|
||||
},
|
||||
webpack: config => {
|
||||
config.module.rules.push({
|
||||
test: /\.js$/,
|
||||
|
Reference in New Issue
Block a user