mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
1a5e7315c0
Default mermaid back to being a CommonJS module. Improrting Mermaid as CommonJS (e.g. using `require("mermaid")`) is normally broken (since v8), due to it's dependency on d3, which is now ESM only. However, it looks like some software (e.g. TypeScript, in the docusaurus project) could still handle the CommonJS version of Mermaid. This commit now means that older versions of Node/build-tools should now default to using the CommonJS version of Mermaid. Newer tools should still see that the `"module"` field points to ESM, or use the `exports["."]["import"]` field to load ESM.