mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-19 12:14:07 +01:00
chore: Refactor build to simplify vite and esbuild
This commit is contained in:
@@ -17,17 +17,12 @@ export default function jsonSchemaPlugin(): PluginOption {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const jsonSchema = loadSchema(src, idAsUrl.pathname);
|
const jsonSchema = loadSchema(src, idAsUrl.pathname);
|
||||||
if (idAsUrl.searchParams.get('only-defaults')) {
|
|
||||||
return {
|
return {
|
||||||
code: getDefaults(jsonSchema),
|
code: idAsUrl.searchParams.get('only-defaults')
|
||||||
|
? getDefaults(jsonSchema)
|
||||||
|
: getSchema(jsonSchema),
|
||||||
map: null, // no source map
|
map: null, // no source map
|
||||||
};
|
};
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
code: getSchema(jsonSchema),
|
|
||||||
map: null, // provide source map if available
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user