mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-14 04:49:44 +02:00
fix: change package json import path
This commit is contained in:
@@ -53,12 +53,13 @@ import mm from 'micromatch';
|
|||||||
// @ts-ignore No typescript declaration file
|
// @ts-ignore No typescript declaration file
|
||||||
import flatmap from 'unist-util-flatmap';
|
import flatmap from 'unist-util-flatmap';
|
||||||
import { visit } from 'unist-util-visit';
|
import { visit } from 'unist-util-visit';
|
||||||
|
import { fileURLToPath } from 'url';
|
||||||
|
|
||||||
// short-circuit `.schema.yaml` imports, so that we can safely import `shapes.js`
|
// short-circuit `.schema.yaml` imports, so that we can safely import `shapes.js`
|
||||||
register('./loadHook.mjs', import.meta.url);
|
register('./loadHook.mjs', import.meta.url);
|
||||||
const { shapesDefs } = await import('../src/rendering-util/rendering-elements/shapes.js');
|
const { shapesDefs } = await import('../src/rendering-util/rendering-elements/shapes.js');
|
||||||
|
const packageJsonPath = join(fileURLToPath(import.meta.url), '../../package.json');
|
||||||
export const MERMAID_RELEASE_VERSION = JSON.parse(readFileSync('../mermaid/package.json', 'utf8'))
|
export const MERMAID_RELEASE_VERSION = JSON.parse(readFileSync(packageJsonPath, 'utf8'))
|
||||||
.version as string;
|
.version as string;
|
||||||
const MERMAID_MAJOR_VERSION = MERMAID_RELEASE_VERSION.split('.')[0];
|
const MERMAID_MAJOR_VERSION = MERMAID_RELEASE_VERSION.split('.')[0];
|
||||||
const CDN_URL = 'https://cdn.jsdelivr.net/npm'; // 'https://unpkg.com';
|
const CDN_URL = 'https://cdn.jsdelivr.net/npm'; // 'https://unpkg.com';
|
||||||
|
Reference in New Issue
Block a user