Files
mermaid/.vite/jisonPlugin.ts
2023-02-19 17:28:35 +05:30

18 lines
380 B
TypeScript

import { transformJison } from '../.esbuild/jisonTransformer.js';
const fileRegex = /\.(jison)$/;
export default function jison() {
return {
name: 'jison',
transform(src: string, id: string) {
if (fileRegex.test(id)) {
return {
code: transformJison(src),
map: null, // provide source map if available
};
}
},
};
}