mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-03 04:14:15 +01:00
chore: Add esbuild (Breaking change)
mermaid.min.js and mermaid.js will now be IIFE instead of UMD.
This commit is contained in:
15
.build/jisonTransformer.ts
Normal file
15
.build/jisonTransformer.ts
Normal 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}`;
|
||||
};
|
||||
Reference in New Issue
Block a user