1
0
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:
Wendell Hu
2020-08-20 00:14:51 +08:00
committed by GitHub
parent 7b2b6df215
commit 912d4b79da
30 changed files with 1598 additions and 1028 deletions

View File

@@ -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$/,