diff --git a/src/imports/defaults.ts b/src/imports/defaults.ts index 10d2e01..146d827 100644 --- a/src/imports/defaults.ts +++ b/src/imports/defaults.ts @@ -8,7 +8,6 @@ export const defaultNodes = [ { name: "BulletList", path: "@tiptap/extension-bullet-list" }, { name: "OrderedList", path: "@tiptap/extension-ordered-list" }, { name: "ListItem", path: "@tiptap/extension-list-item" }, - { name: "CodeBlock", path: "@tiptap/extension-code-block" }, { name: "Document", path: "@tiptap/extension-document" }, { name: "HardBreak", path: "@tiptap/extension-hard-break" }, { name: "Heading", path: "@tiptap/extension-heading" }, diff --git a/src/imports/optional.ts b/src/imports/optional.ts index f2c9aea..bf74eb8 100644 --- a/src/imports/optional.ts +++ b/src/imports/optional.ts @@ -4,3 +4,7 @@ export const lowlightImports = [ { name: "createLowlight", path: "lowlight" }, { name: "CodeBlockLowlight", path: "@tiptap/extension-code-block-lowlight" }, ]; + +export const defaultCodeImports = [ + { name: "CodeBlock", path: "@tiptap/extension-code-block" }, +]; diff --git a/src/module.ts b/src/module.ts index 0173def..d2304cc 100644 --- a/src/module.ts +++ b/src/module.ts @@ -85,6 +85,8 @@ export default defineNuxtModule({ if (!!options.lowlight && options.lowlight !== false) { optionalImports = [...optionalImports, ...allImports.lowlightImports]; + } else { + optionalImports = [...optionalImports, ...allImports.defaultCodeImports]; } optionalComponents = [...optionalComponents]; @@ -104,6 +106,6 @@ export default defineNuxtModule({ ...transpileModules, ]; - console.log("Tiptap Editor initialized") + console.log("Tiptap Editor initialized"); }, });