Skip to content

Instantly share code, notes, and snippets.

@Princesseuh
Last active December 1, 2022 20:07
Show Gist options
  • Save Princesseuh/8ff00494e87b186a1af20e03b96c19cf to your computer and use it in GitHub Desktop.
Save Princesseuh/8ff00494e87b186a1af20e03b96c19cf to your computer and use it in GitHub Desktop.
co-pilot
// 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