fix: Add `.core` build.
This commit is contained in:
parent
ffcb73ad5f
commit
1029ce4527
|
@ -7,8 +7,15 @@ const handler = (e) => {
|
||||||
};
|
};
|
||||||
const watch = process.argv.includes('--watch');
|
const watch = process.argv.includes('--watch');
|
||||||
|
|
||||||
|
// mermaid.js
|
||||||
build(umdBuild({ minify: false, watch })).catch(handler);
|
build(umdBuild({ minify: false, watch })).catch(handler);
|
||||||
|
// mermaid.esm.mjs
|
||||||
build(esmBuild({ minify: false, watch })).catch(handler);
|
build(esmBuild({ minify: false, watch })).catch(handler);
|
||||||
|
|
||||||
|
// mermaid.core.js
|
||||||
|
build(umdBuild({ minify: false, core: true })).catch(handler);
|
||||||
|
|
||||||
|
// mermaid.min.js
|
||||||
build(esmBuild()).catch(handler);
|
build(esmBuild()).catch(handler);
|
||||||
|
// mermaid.esm.min.mjs
|
||||||
build(umdBuild()).catch(handler);
|
build(umdBuild()).catch(handler);
|
||||||
|
|
|
@ -39,12 +39,17 @@ exports.esmBuild = (override = { minify: true }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Options} override
|
* @param {Options & { core?: boolean }} override
|
||||||
* @returns {Options}
|
* @returns {Options}
|
||||||
*/
|
*/
|
||||||
exports.umdBuild = (override = { minify: true }) => {
|
exports.umdBuild = (override = { minify: true, core: false }) => {
|
||||||
|
const core = override.core;
|
||||||
|
if (core && override.minify) {
|
||||||
|
throw new Error('Cannot minify core build');
|
||||||
|
}
|
||||||
|
delete override.core;
|
||||||
return buildOptions({
|
return buildOptions({
|
||||||
outfile: `dist/mermaid${override.minify ? '.min' : ''}.js`,
|
outfile: `dist/mermaid${override.minify ? '.min' : core ? '.core' : ''}.js`,
|
||||||
...override,
|
...override,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue