mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-16 12:39:58 +02:00
fix: Core build externals
This commit is contained in:
@@ -56,7 +56,7 @@ interface BuildOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions): InlineConfig => {
|
export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions): InlineConfig => {
|
||||||
const external = ['require', 'fs', 'path'];
|
const external: (string | RegExp)[] = ['require', 'fs', 'path'];
|
||||||
console.log(entryName, packageOptions[entryName]);
|
console.log(entryName, packageOptions[entryName]);
|
||||||
const { name, file, packageName } = packageOptions[entryName];
|
const { name, file, packageName } = packageOptions[entryName];
|
||||||
let output: OutputOptions = [
|
let output: OutputOptions = [
|
||||||
@@ -80,7 +80,7 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
|
|||||||
);
|
);
|
||||||
// Core build is used to generate file without bundled dependencies.
|
// Core build is used to generate file without bundled dependencies.
|
||||||
// This is used by downstream projects to bundle dependencies themselves.
|
// This is used by downstream projects to bundle dependencies themselves.
|
||||||
external.push(...Object.keys(dependencies));
|
external.push(new RegExp('^(?:' + Object.keys(dependencies).join('|') + ')(?:/.+)?$'));
|
||||||
// This needs to be an array. Otherwise vite will build esm & umd with same name and overwrite esm with umd.
|
// This needs to be an array. Otherwise vite will build esm & umd with same name and overwrite esm with umd.
|
||||||
output = [
|
output = [
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user