MCPcopy Create free account
hub / github.com/BuilderIO/framework-benchmarks / cssReplacePlugin

Function cssReplacePlugin

apps/components/mitosis.config.js:44–61  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

42 * '@media screen and (max-width: 640px)': { .. }
43 */
44const cssReplacePlugin = (options) => () => ({
45 json: {
46 pre: (json) => {
47 traverse(json).forEach(function (item) {
48 if (item?.['@type'] === '@builder.io/mitosis/node') {
49 if (item.bindings?.css?.code) {
50 for (const key of Object.keys(options)) {
51 item.bindings.css.code = item.bindings.css.code.replace(
52 new RegExp(escapeRegExp(key), 'g'),
53 options[key]
54 );
55 }
56 }
57 }
58 });
59 },
60 },
61});
62
63const stripSvelteNonRootStyle = () => () => ({
64 code: {

Callers 1

mitosis.config.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected