Skip to content

Commit 4739b0d

Browse files
committed
Re-enable pnpm hoisting and transform Docusaurus config to TS
1 parent fbf44dc commit 4739b0d

File tree

3 files changed

+1808
-1825
lines changed

3 files changed

+1808
-1825
lines changed

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shamefully-hoist=true

docusaurus.config.js renamed to docusaurus.config.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
// @ts-check
22
// Note: type annotations allow type checking and IDEs autocompletion
33

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';
59

610
const PUBLIC_BASE_URL = 'https://public-ui.github.io';
711

8-
/** @type {import('@docusaurus/types').Config} */
9-
const config = {
12+
const config: Config = {
1013
title: 'KoliBri - Public UI',
1114
tagline: 'The accessible Web Component Library',
1215
url: PUBLIC_BASE_URL,
@@ -37,7 +40,7 @@ const config = {
3740
docs: {
3841
routeBasePath: '/docs',
3942
sidebarCollapsible: true,
40-
sidebarPath: require.resolve('./sidebars.js'),
43+
sidebarPath: './sidebars.js',
4144
// Remove this to remove the "edit this page" links.
4245
// editUrl: 'https://github.com/public-ui/documentation/blob/main/packages/docusaurus/',
4346
// lastVersion: 'current',
@@ -56,7 +59,7 @@ const config = {
5659
filename: 'sitemap.xml',
5760
},
5861
theme: {
59-
customCss: require.resolve('./src/css/custom.css'),
62+
customCss: './src/css/custom.css',
6063
},
6164
},
6265
],
@@ -191,10 +194,15 @@ const config = {
191194
async () => {
192195
return {
193196
name: 'docusaurus-tailwindcss',
194-
configurePostCss(postcssOptions) {
197+
198+
configurePostCss(postcssOptions: PostCssOptions) {
195199
// 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());
198206
return postcssOptions;
199207
},
200208
};
@@ -242,4 +250,4 @@ const config = {
242250
themes: ['@docusaurus/theme-mermaid'],
243251
};
244252

245-
module.exports = config;
253+
export default config;

0 commit comments

Comments
 (0)