
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
@rcdoc/vitejs-plugin
Advanced tools
A plugin enables you to import a Markdown file as various formats on your [vite](https://github.com/vitejs/vite) project inspirt by [dumi](https://github.com/umijs/dumi).
mdoc for vite
A plugin enables you to import a Markdown file as various formats on your vite project inspirt by dumi.
npm i -D vite-plugin-react-mdoc
const mdoc = require('vite-plugin-react-mdoc');
module.exports = {
plugins: [mdoc(options)],
};
Then you can import front matter attributes from .md file as default.
# Hello world
```tsx
import React from 'react';
export default () => {
const [count, setCount] = React.useState(0);
return <button onClick={() => setCount((v) => v + 1)}>count: {count}</button>;
};
```
import { MdContent, demos } from './doc.md';
In TypeScript project, need to declare typedefs for .md file as you need.
declare module '*.md' {
// When "Mode.React" is requested. VFC could take a generic like React.VFC<{ MyComponent: TypeOfMyComponent }>
import React from 'react';
type MDocPreviewerProps = {
code: string;
lang: string;
key: string;
dependencies: Record<
string,
{
type: string;
value: string;
css: boolean;
}
>;
meta: Record<string, any>;
children: React.ReactNode;
};
const MdContent: React.VFC<{
previewer?: (props: MDocPreviewerProps) => React.ReactNode;
}>;
const demos: ({ Component: React.VFC; key: string } & Record<string, any>)[];
const frontmatter: Record<string, string>;
const slugs: { depth: number; text: string; id: string }[];
const filePath: string;
// Modify below per your usage
export { MdContent, demos, frontmatter, slugs, filePath };
}
Save as vite.d.ts for instance.
MIT
FAQs
A plugin enables you to import a Markdown file as various formats on your [vite](https://github.com/vitejs/vite) project inspirt by [dumi](https://github.com/umijs/dumi).
The npm package @rcdoc/vitejs-plugin receives a total of 7 weekly downloads. As such, @rcdoc/vitejs-plugin popularity was classified as not popular.
We found that @rcdoc/vitejs-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.