UNPKG

stackpress

Version:

Incept is a content management framework.

17 lines (16 loc) 527 B
import path from 'node:path'; import { fileURLToPath } from 'node:url'; export default function plugin(ctx) { ctx.on('idea', async (req) => { const transformer = req.data('transformer'); const schema = await transformer.schema(); if (!schema.plugin) { schema.plugin = {}; } const dirname = typeof __dirname === 'undefined' ? path.dirname(fileURLToPath(import.meta.url)) : __dirname; schema.plugin[`${dirname}/transform`] = {}; }); } ;