currentConfig is incorrectly bundled over multiple files #4345
Labels
Status: Triage
Needs to be verified, categorized, etc
Type: Bug / Error
Something isn't working or is incorrect
Description
I'm noticing that currentConfig (in config.ts) is incorrectly split by Vite/RollUp over multiple files. This causes some scripts to not get the same currentConfig as others.
Steps to reproduce
I am trying to add a
curve
configuration option to the ER diagram. That is where I ran into this issue. The only relevant code needed to reproduce this issue:curve?: string;
tointerface ErDiagramConfig
inpackages/mermaid/src/config.type.ts
curve: 'basis',
toconfig.er
inpackages/mermaid/src/defaultConfig.ts
er: { curve: 'step' },
to the config object inmermaid.initialize
indemos/er.html
console.trace(conf.curve)
at the top ofdrawRelationshipFromLayout
inpackages/mermaid/src/diagrams/er/erRenderer.js
pnpm run dev
It should be expected that the console.log logs 'step', but instead it logs 'basis'. If you inspect in the browser which files exist, you will see two files containing
let currentConfig
and an exportedgetConfig
function. This means some code uses a different config than others.Screenshots
Code Sample
fork
Setup
Additional Context
I've tried messing with these options inside
.vite/build.ts
, but to no avail (my knowledge of Vite and Rollup is insufficient atm):Thanks for the great project, loving it!
Hope this bug report helps, let me know if you need more info 😊
The text was updated successfully, but these errors were encountered: