mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-26 02:39:41 +02:00
ESM only
This commit is contained in:
@@ -7,14 +7,7 @@ const handler = (e) => {
|
||||
};
|
||||
const watch = process.argv.includes('--watch');
|
||||
|
||||
// mermaid.js
|
||||
build(iifeBuild({ minify: false, watch })).catch(handler);
|
||||
// mermaid.esm.mjs
|
||||
build(esmBuild({ minify: false, watch })).catch(handler);
|
||||
|
||||
// mermaid.min.js
|
||||
build(esmBuild()).catch(handler);
|
||||
// mermaid.esm.min.mjs
|
||||
build(iifeBuild()).catch(handler);
|
||||
// mermaid.core.mjs (node_modules unbundled)
|
||||
build(esmCoreBuild()).catch(handler);
|
||||
|
@@ -29,7 +29,6 @@ const buildOptions = (override = {}) => {
|
||||
const getOutFiles = (extension) => {
|
||||
return {
|
||||
[`mermaid${extension}`]: 'src/mermaid.ts',
|
||||
[`diagramAPI${extension}`]: 'src/diagram-api/diagramAPI.ts',
|
||||
};
|
||||
};
|
||||
/**
|
||||
@@ -69,22 +68,6 @@ exports.esmCoreBuild = (override) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Build options for mermaid.js build.
|
||||
*
|
||||
* For IIFE browser use (where ESM is not yet supported).
|
||||
*
|
||||
* @param {Options} override - Override options.
|
||||
* @returns {Options} ESBuild build options.
|
||||
*/
|
||||
exports.iifeBuild = (override = { minify: true }) => {
|
||||
return buildOptions({
|
||||
entryPoints: getOutFiles(override.minify ? '.min' : ''),
|
||||
format: 'iife',
|
||||
...override,
|
||||
});
|
||||
};
|
||||
|
||||
const jisonPlugin = {
|
||||
name: 'jison',
|
||||
setup(build) {
|
||||
|
Reference in New Issue
Block a user