1
1
// @ts -check
2
2
// Note: type annotations allow type checking and IDEs autocompletion
3
3
4
- const { themes } = require ( 'prism-react-renderer' ) ;
4
+ import { themes } from 'prism-react-renderer' ;
5
+ import type { Config } from '@docusaurus/types' ;
6
+ import type { PostCssOptions } from '@docusaurus/types' ;
7
+ import tailwindcss from 'tailwindcss' ;
8
+ import autoprefixer from 'autoprefixer' ;
5
9
6
10
const PUBLIC_BASE_URL = 'https://public-ui.github.io' ;
7
11
8
- /** @type {import('@docusaurus/types').Config } */
9
- const config = {
12
+ const config : Config = {
10
13
title : 'KoliBri - Public UI' ,
11
14
tagline : 'The accessible Web Component Library' ,
12
15
url : PUBLIC_BASE_URL ,
@@ -37,7 +40,7 @@ const config = {
37
40
docs : {
38
41
routeBasePath : '/docs' ,
39
42
sidebarCollapsible : true ,
40
- sidebarPath : require . resolve ( './sidebars.js' ) ,
43
+ sidebarPath : './sidebars.js' ,
41
44
// Remove this to remove the "edit this page" links.
42
45
// editUrl: 'https://github.com/public-ui/documentation/blob/main/packages/docusaurus/',
43
46
// lastVersion: 'current',
@@ -56,7 +59,7 @@ const config = {
56
59
filename : 'sitemap.xml' ,
57
60
} ,
58
61
theme : {
59
- customCss : require . resolve ( './src/css/custom.css' ) ,
62
+ customCss : './src/css/custom.css' ,
60
63
} ,
61
64
} ,
62
65
] ,
@@ -191,10 +194,15 @@ const config = {
191
194
async ( ) => {
192
195
return {
193
196
name : 'docusaurus-tailwindcss' ,
194
- configurePostCss ( postcssOptions ) {
197
+
198
+ configurePostCss ( postcssOptions : PostCssOptions ) {
195
199
// Appends TailwindCSS and AutoPrefixer.
196
- postcssOptions . plugins . push ( require ( 'tailwindcss' ) ) ;
197
- postcssOptions . plugins . push ( require ( 'autoprefixer' ) ) ;
200
+ if ( ! Array . isArray ( postcssOptions . plugins ) ) {
201
+ postcssOptions . plugins = [ ] ;
202
+ }
203
+
204
+ postcssOptions . plugins . push ( tailwindcss ( ) ) ;
205
+ postcssOptions . plugins . push ( autoprefixer ( ) ) ;
198
206
return postcssOptions ;
199
207
} ,
200
208
} ;
@@ -242,4 +250,4 @@ const config = {
242
250
themes : [ '@docusaurus/theme-mermaid' ] ,
243
251
} ;
244
252
245
- module . exports = config ;
253
+ export default config ;
0 commit comments