Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions doc-kit.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import { resolve, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';

const __dirname = dirname(fileURLToPath(import.meta.url));

/**
* Configuration for @node-core/doc-kit when generating webpack API docs.
*
Expand All @@ -18,6 +23,13 @@ export default {
web: {
// Use "webpack" as the product name in navbar and sidebar labels
title: 'webpack',

// Override the default Node.js theming components with webpack-specific ones.
// These aliases are resolved by the bundler during the doc-kit build step.
// @see https://github.com/nodejs/doc-kit/issues/665
imports: {
'#theme/Logo': resolve(__dirname, './ui/WebpackLogo.jsx'),
},
},
'jsx-ast': {
// Disable the "Edit this page" link — webpack API docs are generated from
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"prepare": "husky"
},
"dependencies": {
"@node-core/doc-kit": "^1.2.0",
"@node-core/doc-kit": "^1.2.1",
"semver": "^7.7.4",
"typedoc": "^0.28.18",
"typedoc-plugin-markdown": "^4.11.0",
Expand Down
35 changes: 35 additions & 0 deletions ui/WebpackLogo.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Webpack logo component for use as the #theme/Logo override.
* Based on the official webpack brand assets.
* @see https://webpack.js.org
*/
const WebpackLogo = props => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 1200 1200"
width="32"
height="32"
aria-label="webpack"
role="img"
{...props}
>
<path
fill="#fff"
d="M600 60 L1110 340 L1110 860 L600 1140 L90 860 L90 340 Z"
/>
<path
fill="#8ED6FB"
d="M600 143 L1051 400 L1051 800 L600 1057 L149 800 L149 400 Z"
/>
<path
fill="#1C78C0"
d="M600 233 L992 460 L992 740 L600 967 L208 740 L208 460 Z"
/>
<path
fill="#fff"
d="M382 480 L470 480 L530 680 L600 480 L670 480 L740 680 L800 480 L888 480 L780 760 L710 760 L640 560 L560 760 L490 760 Z"
/>
</svg>
);

export default WebpackLogo;