Skip to content

Commit

Permalink
feat: auto import parseMarkdown
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Dec 5, 2023
1 parent 64e46e2 commit 5182df2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineNuxtModule, extendViteConfig, addComponent, addComponentsDir, createResolver, addServerHandler, addTemplate, addImports } from '@nuxt/kit'
import { defineNuxtModule, extendViteConfig, addComponent, addComponentsDir, createResolver, addServerHandler, addTemplate, addImports, addServerImports } from '@nuxt/kit'
import fs from 'fs'
import { mdcImportTemplate } from './utils/templates'
import type { ModuleOptions } from './types'
Expand Down Expand Up @@ -84,6 +84,10 @@ export default defineNuxtModule<ModuleOptions>({
// Add composables
addImports({ from: resolver.resolve('./runtime/utils/node'), name: 'flatUnwrap', as: 'unwrapSlot' })

// Add parser
addImports({ from: resolver.resolve('./runtime/parser'), name: 'parseMarkdown', as: 'parseMarkdown' })
addServerImports([{ from: resolver.resolve('./runtime/parser'), name: 'parseMarkdown', as: 'parseMarkdown' }])

// Register prose components
if (options.components?.prose) {
addComponentsDir({
Expand Down

0 comments on commit 5182df2

Please sign in to comment.