chore: Add esbuild (Breaking change)

mermaid.min.js and mermaid.js will now be IIFE instead of UMD.
This commit is contained in:
Sidharth Vinod
2023-08-13 18:33:41 +05:30
parent 43217e1395
commit da7ff777d1
31 changed files with 1121 additions and 470 deletions

View File

@@ -0,0 +1,15 @@
import jison from 'jison';
export const transformJison = (src: string): string => {
const parser = new jison.Generator(src, {
moduleType: 'js',
'token-stack': true,
});
const source = parser.generate({ moduleMain: '() => {}' });
const exporter = `
parser.parser = parser;
export { parser };
export default parser;
`;
return `${source} ${exporter}`;
};