@@ -2,16 +2,24 @@ import { withGuildDocs } from 'guild-docs/next.config';
22import { CategoryToPackages } from './src/category-to-packages.mjs' ;
33
44const PLUGINS_REDIRECTS = Object . entries ( CategoryToPackages ) . flatMap ( ( [ category , packageNames ] ) =>
5- packageNames . map ( packageName => ( {
6- source : `/plugins/${ packageName } ` ,
7- destination : `/plugins/${ category } /${ packageName } ` ,
8- } ) )
5+ packageNames . map ( packageName => [ `/plugins/${ packageName } ` , `/plugins/${ category } /${ packageName } ` ] )
96) ;
10-
117export default withGuildDocs ( {
8+ basePath : process . env . NEXT_BASE_PATH && process . env . NEXT_BASE_PATH !== '' ? process . env . NEXT_BASE_PATH : undefined ,
129 eslint : {
1310 ignoreDuringBuilds : true ,
1411 } ,
12+ experimental : {
13+ urlImports : [
14+ 'https://graphql-modules.com/assets/subheader-logo.svg' ,
15+ 'https://pbs.twimg.com/profile_images/1004185780313395200/ImZxrDWf_400x400.jpg' ,
16+ 'https://raw.githubusercontent.com/mswjs/msw/HEAD/media/msw-logo.svg' ,
17+ ] ,
18+ images : {
19+ unoptimized : true , // doesn't work with `next export`
20+ allowFutureImage : true ,
21+ } ,
22+ } ,
1523 typescript : {
1624 // Todo: remove it before merge to master
1725 ignoreBuildErrors : true ,
@@ -24,54 +32,23 @@ export default withGuildDocs({
2432 return config ;
2533 } ,
2634 redirects : ( ) =>
27- [
28- {
29- source : '/docs/presets/:presetName' ,
30- destination : '/plugins/:presetName-preset' ,
31- } ,
32- {
33- source : '/docs/plugins/:pluginName' ,
34- destination : '/plugins/:pluginName' ,
35- } ,
36- {
37- source : '/docs/getting-started/config-reference/codegen-config' ,
38- destination : '/docs/config-reference/codegen-config' ,
39- } ,
40- {
41- source : '/docs/getting-started/codegen-config' ,
42- destination : '/docs/config-reference/codegen-config' ,
43- } ,
44- {
45- source : '/docs/getting-started/documents-field' ,
46- destination : '/docs/config-reference/documents-field' ,
47- } ,
48- {
49- source : '/docs/getting-started/schema-field' ,
50- destination : '/docs/config-reference/schema-field' ,
51- } ,
52- {
53- source : '/docs/getting-started/config-field' ,
54- destination : '/docs/config-reference/config-field' ,
55- } ,
56- {
57- source : '/docs/getting-started/lifecycle-hooks' ,
58- destination : '/docs/config-reference/lifecycle-hooks' ,
59- } ,
60- {
61- source : '/docs/getting-started/require-field' ,
62- destination : '/docs/config-reference/require-field' ,
63- } ,
64- {
65- source : '/docs/getting-started/naming-convention' ,
66- destination : '/docs/config-reference/naming-convention' ,
67- } ,
68- {
69- source : '/docs/getting-started/how-does-it-work' ,
70- destination : '/docs/advanced/how-does-it-work' ,
71- } ,
72- ...PLUGINS_REDIRECTS ,
73- ] . map ( redirect => ( {
74- ...redirect ,
75- permanent : true ,
76- } ) ) ,
35+ Object . entries ( {
36+ '/docs/presets/:presetName' : '/plugins/:presetName-preset' ,
37+ '/docs/plugins/:pluginName' : '/plugins/:pluginName' ,
38+ '/docs/getting-started/config-reference/codegen-config' : '/docs/config-reference/codegen-config' ,
39+ '/docs/getting-started/codegen-config' : '/docs/config-reference/codegen-config' ,
40+ '/docs/getting-started/documents-field' : '/docs/config-reference/documents-field' ,
41+ '/docs/getting-started/schema-field' : '/docs/config-reference/schema-field' ,
42+ '/docs/getting-started/config-field' : '/docs/config-reference/config-field' ,
43+ '/docs/getting-started/lifecycle-hooks' : '/docs/config-reference/lifecycle-hooks' ,
44+ '/docs/getting-started/require-field' : '/docs/config-reference/require-field' ,
45+ '/docs/getting-started/naming-convention' : '/docs/config-reference/naming-convention' ,
46+ '/docs/getting-started/how-does-it-work' : '/docs/advanced/how-does-it-work' ,
47+ } )
48+ . concat ( PLUGINS_REDIRECTS )
49+ . map ( ( [ from , to ] ) => ( {
50+ source : from ,
51+ destination : to ,
52+ permanent : true ,
53+ } ) ) ,
7754} ) ;
0 commit comments