mermaid/.vite/jisonPlugin.js
2022-09-22 15:35:22 +05:30

18 lines
354 B
JavaScript

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