@nuxtjs/mdc 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -3
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -2,7 +2,6 @@ import { createResolver, extendViteConfig, defineNuxtModule, addTemplate, addCom
|
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import { pascalCase } from 'scule';
|
|
4
4
|
import { defu } from 'defu';
|
|
5
|
-
import { RENDER_SLOT } from '@vue/compiler-core';
|
|
6
5
|
|
|
7
6
|
const mdcImportTemplate = async ({ nuxt, options }) => {
|
|
8
7
|
const resolver = createResolver(import.meta.url);
|
|
@@ -40,7 +39,7 @@ function processUnistPlugins(plugins) {
|
|
|
40
39
|
Object.entries(plugins).forEach(([name, plugin]) => {
|
|
41
40
|
imports.push(`import ${pascalCase(name)} from '${name}'`);
|
|
42
41
|
if (Object.keys(plugin).length) {
|
|
43
|
-
definitions.push(` '${name}': { instance: ${pascalCase(name)},
|
|
42
|
+
definitions.push(` '${name}': { instance: ${pascalCase(name)}, options: ${JSON.stringify(plugin)} },`);
|
|
44
43
|
} else {
|
|
45
44
|
definitions.push(` '${name}': { instance: ${pascalCase(name)} },`);
|
|
46
45
|
}
|
|
@@ -61,7 +60,7 @@ const registerMDCSlotTransformer = (resolver) => {
|
|
|
61
60
|
node.tagType = 2;
|
|
62
61
|
transform?.(node, context);
|
|
63
62
|
const codegen = context.ssr ? node.ssrCodegenNode : node.codegenNode;
|
|
64
|
-
codegen.callee =
|
|
63
|
+
codegen.callee = context.ssr ? "_ssrRenderMDCSlot" : "_renderMDCSlot";
|
|
65
64
|
const importExp = context.ssr ? "{ ssrRenderSlot as _ssrRenderMDCSlot }" : "{ renderSlot as _renderMDCSlot }";
|
|
66
65
|
if (!context.imports.some((i) => String(i.exp) === importExp)) {
|
|
67
66
|
context.imports.push({
|