Skip to content

Commit 29395d9

Browse files
authored
Fix docs build (#10566)
1 parent e798def commit 29395d9

File tree

5 files changed

+9439
-5858
lines changed

5 files changed

+9439
-5858
lines changed

Diff for: docs/.vuepress/config.cjs renamed to docs/.vuepress/config.ts

+14-19
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
const path = require('path');
1+
import { DefaultThemeConfig, defineConfig, PluginTuple } from "vuepress/config";
2+
import * as path from 'path';
3+
import markdownItInclude from 'markdown-it-include';
4+
25
const docsVersion = "VERSION";
3-
const base = process.env.NODE_ENV === "development" ? '/docs/master/' : `/docs/${docsVersion}/`;
6+
const base: `/${string}/` = process.env.NODE_ENV === "development" ? '/docs/master/' : `/docs/${docsVersion}/`;
47

5-
module.exports = {
8+
export default defineConfig({
69
title: 'Chart.js',
710
description: 'Open source HTML5 Charts for your website',
811
theme: 'chartjs',
@@ -30,16 +33,10 @@ module.exports = {
3033
],
3134
}],
3235
['vuepress-plugin-code-copy', true],
33-
[
34-
'vuepress-plugin-typedoc',
35-
{
36+
['vuepress-plugin-typedoc', {
3637
entryPoints: ['../../types/index.d.ts'],
3738
hideInPageTOC: true,
3839
tsconfig: 'tsconfig.json',
39-
sidebar: {
40-
fullNames: true,
41-
parentCategory: 'API',
42-
},
4340
},
4441
],
4542
['@simonbrunel/vuepress-plugin-versions', {
@@ -48,7 +45,7 @@ module.exports = {
4845
title: (v, vars) => {
4946
return window.location.href.includes('master') ? 'Development (master)' :
5047
vars.tag === 'latest' ? 'Latest (' + v + ')' :
51-
v + (vars.tag ? ` (${tag})` : '') + ' (outdated)';
48+
v + (vars.tag ? ` (${vars.tag})` : '') + ' (outdated)';
5249
},
5350
},
5451
menu: {
@@ -89,7 +86,7 @@ module.exports = {
8986
]
9087
},
9188
}],
92-
],
89+
] as PluginTuple[],
9390
chainWebpack(config) {
9491
config.merge({
9592
resolve: {
@@ -101,7 +98,7 @@ module.exports = {
10198
},
10299
markdown: {
103100
extendMarkdown: md => {
104-
md.use(require('markdown-it-include'), path.resolve(__dirname, '../'));
101+
md.use(markdownItInclude, path.resolve(__dirname, '../'));
105102
}
106103
},
107104
themeConfig: {
@@ -134,9 +131,7 @@ module.exports = {
134131
}
135132
],
136133
sidebar: {
137-
'/api/': {
138-
title: 'API'
139-
},
134+
'/api/': 'API',
140135
'/samples/': [
141136
'information',
142137
{
@@ -389,6 +384,6 @@ module.exports = {
389384
]
390385
},
391386
],
392-
}
393-
}
394-
};
387+
} as any
388+
} as DefaultThemeConfig
389+
});

0 commit comments

Comments
 (0)