Node Modules
The Dev Portal supports installing and using custom node modules in your documentation. This allows you to extend your documentation with custom React components, utilities, or any other npm packages.
Installing Custom Packages
Inside your project's /docs
directory, you can install any npm package using
the standard npm commands:
bash
Using Custom React Components
You can import and use custom React components directly in the
zudoku.config.tsx
file or your MDX files:
jsx
TypeScript Support
The Dev Portal includes full TypeScript support for your custom components. Make
sure your tsconfig.json
includes the appropriate type definitions for your
packages.
Limitations
While you can use most npm packages, be mindful of:
- Package size impact on build time
- Browser compatibility for client-side components
- Node.js-specific packages (like
fs
orpath
) cannot be used inzudoku.config.tsx
since it runs in both server and browser environments - use environment-agnostic code only