fix: Core build
This commit is contained in:
parent
8c63d002e7
commit
1e71798467
|
@ -36,13 +36,17 @@ export const getBuildConfig = ({ minify, core, watch }: BuildOptions): InlineCon
|
|||
];
|
||||
|
||||
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));
|
||||
output = {
|
||||
name: 'mermaid',
|
||||
format: 'esm',
|
||||
sourcemap: true,
|
||||
entryFileNames: `[name].core.mjs`,
|
||||
};
|
||||
// This needs to be an array. Otherwise vite will build esm & umd with same name and overwrite esm with umd.
|
||||
output = [
|
||||
{
|
||||
format: 'esm',
|
||||
sourcemap: true,
|
||||
entryFileNames: `[name].core.mjs`,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
const config: InlineConfig = {
|
||||
|
@ -81,5 +85,5 @@ if (watch) {
|
|||
} else {
|
||||
build(getBuildConfig({ minify: false }));
|
||||
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
|
||||
* functionality and to render the diagrams to svg code.
|
||||
|
|
Loading…
Reference in New Issue