Adding example diagram as a template for a new diagram

This commit is contained in:
Knut Sveidqvist
2022-09-28 17:49:47 +02:00
parent bed9b1bb99
commit f46f8752ca
15 changed files with 374 additions and 16 deletions

View File

@@ -29,6 +29,16 @@ const packageOptions = {
packageName: 'mermaid-mindmap',
file: 'registry.ts',
},
'mermaid-example-diagram': {
name: 'mermaid-example-diagram',
packageName: 'mermaid-example-diagram',
file: 'add-diagram.ts',
},
'mermaid-example-diagram-detector': {
name: 'mermaid-example-diagram-detector',
packageName: 'mermaid-example-diagram',
file: 'registry.ts',
},
};
interface BuildOptions {
@@ -97,7 +107,11 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
if (watch && config.build) {
config.build.watch = {
include: ['packages/mermaid-mindmap/src/**', 'packages/mermaid/src/**'],
include: [
'packages/mermaid-mindmap/src/**',
'packages/mermaid/src/**',
'packages/mermaid-example-diagram/src/**',
],
};
}
@@ -122,6 +136,7 @@ const main = async () => {
if (watch) {
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid' }));
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-mindmap' }));
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-example-diagram' }));
} else {
void main();
}