mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
chore: Add tiny bundle
Excludes elk and mindmap at build time
This commit is contained in:
@@ -14,6 +14,7 @@ interface MermaidBuildOptions {
|
||||
metafile?: boolean;
|
||||
format?: 'esm' | 'iife';
|
||||
entryName: keyof typeof packageOptions;
|
||||
includeLargeDiagrams?: boolean;
|
||||
}
|
||||
|
||||
const buildOptions = (override: BuildOptions): BuildOptions => {
|
||||
@@ -37,7 +38,8 @@ export const getBuildConfig = ({
|
||||
core,
|
||||
entryName,
|
||||
metafile,
|
||||
format,
|
||||
format = 'esm',
|
||||
includeLargeDiagrams = true,
|
||||
}: MermaidBuildOptions): BuildOptions => {
|
||||
const external: string[] = ['require', 'fs', 'path'];
|
||||
const { name, file, packageName } = packageOptions[entryName];
|
||||
@@ -45,11 +47,15 @@ export const getBuildConfig = ({
|
||||
absWorkingDir: resolve(__dirname, `../packages/${packageName}`),
|
||||
entryPoints: {
|
||||
[`${name}${core ? '.core' : format === 'iife' ? '' : '.esm'}${
|
||||
minify ? '.min' : ''
|
||||
}`]: `src/${file}`,
|
||||
includeLargeDiagrams ? '' : '.tiny'
|
||||
}${minify ? '.min' : ''}`]: `src/${file}`,
|
||||
},
|
||||
metafile,
|
||||
logLevel: 'info',
|
||||
define: {
|
||||
// This needs to be stringified for esbuild
|
||||
includeLargeDiagrams: `${includeLargeDiagrams}`,
|
||||
},
|
||||
});
|
||||
|
||||
if (core) {
|
||||
|
Reference in New Issue
Block a user