Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imzbf/vite-plugin-import-markdown
Import markdown as a module
https://github.com/imzbf/vite-plugin-import-markdown
markdown vite
Last synced: about 1 month ago
JSON representation
Import markdown as a module
- Host: GitHub
- URL: https://github.com/imzbf/vite-plugin-import-markdown
- Owner: imzbf
- Created: 2023-03-20T09:44:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-25T09:57:05.000Z (8 months ago)
- Last Synced: 2024-09-24T19:43:38.162Z (about 2 months ago)
- Topics: markdown, vite
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @vavt/vite-plugin-import-markdown
Import markdown as a module.
## Usage
- Install
```shell
yarn add @vavt/vite-plugin-import-markdown
```- Config
`vite.config.ts`
```ts
import { defineConfig } from 'vite';
import markdown from '@vavt/vite-plugin-import-markdown';// https://vitejs.dev/config/
export default defineConfig({
plugins: [markdown()],
});
````vite-env.d.ts`
```ts
declare module '*.md';
````file.ts`
```ts
import mdText from './text.md';console.log('Source Text: ', mdText);
```