Last active
December 1, 2022 20:07
-
-
Save Princesseuh/8ff00494e87b186a1af20e03b96c19cf to your computer and use it in GitHub Desktop.
co-pilot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Vite plugin to parse markdown | |
function markdownPlugin() { | |
return { | |
name: 'markdown', | |
transform(code, id) { | |
if (!id.endsWith('.md')) return | |
return `export default ${JSON.stringify(marked(code))}` | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment