MCPcopy
hub / github.com/BuilderIO/mitosis / runPreCodePlugins

Function runPreCodePlugins

packages/core/src/modules/plugins.ts:44–63  ·  view source on GitHub ↗
({
  code,
  plugins,
  options,
  json,
}: {
  json: MitosisComponent;
  code: string;
  plugins: MitosisPlugin[];
  options?: any;
})

Source from the content-addressed store, hash-verified

42};
43
44export const runPreCodePlugins = ({
45 code,
46 plugins,
47 options,
48 json,
49}: {
50 json: MitosisComponent;
51 code: string;
52 plugins: MitosisPlugin[];
53 options?: any;
54}) => {
55 let string = code;
56 for (const plugin of plugins) {
57 const preFunction = plugin(options).code?.pre;
58 if (preFunction) {
59 string = preFunction(string, json);
60 }
61 }
62 return string;
63};
64
65export const runPostCodePlugins = ({
66 code,

Callers 15

componentToMitosisFunction · 0.90
componentToReactFunction · 0.90
componentToAlpineFunction · 0.90
componentToQwikFunction · 0.90
componentToMarkoFunction · 0.90
componentToSolidFunction · 0.90
componentToHtmlFunction · 0.90
componentToCustomElementFunction · 0.90
componentToStencilFunction · 0.90
componentToTemplateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected