mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-25 10:20:06 +02:00
fix: Core build
This commit is contained in:
@@ -36,13 +36,17 @@ export const getBuildConfig = ({ minify, core, watch }: BuildOptions): InlineCon
|
|||||||
];
|
];
|
||||||
|
|
||||||
if (core) {
|
if (core) {
|
||||||
|
// Core build is used to generate file without bundled dependencies.
|
||||||
|
// This is used by downstream projects to bundle dependencies themselves.
|
||||||
external.push(...Object.keys(dependencies));
|
external.push(...Object.keys(dependencies));
|
||||||
output = {
|
// This needs to be an array. Otherwise vite will build esm & umd with same name and overwrite esm with umd.
|
||||||
name: 'mermaid',
|
output = [
|
||||||
format: 'esm',
|
{
|
||||||
sourcemap: true,
|
format: 'esm',
|
||||||
entryFileNames: `[name].core.mjs`,
|
sourcemap: true,
|
||||||
};
|
entryFileNames: `[name].core.mjs`,
|
||||||
|
},
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
const config: InlineConfig = {
|
const config: InlineConfig = {
|
||||||
@@ -81,5 +85,5 @@ if (watch) {
|
|||||||
} else {
|
} else {
|
||||||
build(getBuildConfig({ minify: false }));
|
build(getBuildConfig({ minify: false }));
|
||||||
build(getBuildConfig({ minify: 'esbuild' }));
|
build(getBuildConfig({ minify: 'esbuild' }));
|
||||||
build(getBuildConfig({ minify: true, core: true }));
|
build(getBuildConfig({ minify: false, core: true }));
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
'use strict';
|
|
||||||
/**
|
/**
|
||||||
* Web page integration module for the mermaid framework. It uses the mermaidAPI for mermaid
|
* Web page integration module for the mermaid framework. It uses the mermaidAPI for mermaid
|
||||||
* functionality and to render the diagrams to svg code.
|
* functionality and to render the diagrams to svg code.
|
||||||
|
Reference in New Issue
Block a user