Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(sdk): build a Node.JS version of @mermaidchart/sdk #4

Merged
merged 4 commits into from
Nov 21, 2023

Conversation

aloisklink
Copy link
Contributor

Currently, the @mermaidchart/sdk package only builds an IIFE bundle for use in a browser.

Unfortunately, this doesn't work in Node.JS, so I've instead built an ESM version for Node.JS.

This package will now be built automatically when running `npm install`
or `npm publish`.
ESM imports require a file-extension in Node.JS.
TypeScript has a [node16][1] rule for this.

[1]: https://www.typescriptlang.org/docs/handbook/modules/reference.html#node16-nodenext
Currently, the @mermaidchart/sdk is for browsers only, since it compiles
an IIFE build. This commit adds an ESM output so we can use it for
Node.JS (or even for browsers if we want to use tree-shaking).
Copy link

vercel bot commented Nov 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
office-plugin-site ⬜️ Ignored (Inspect) Nov 21, 2023 2:43pm

@aloisklink aloisklink changed the title build(sdk): build an Node.JS version of @mermaidchart/sdk build(sdk): build a Node.JS version of @mermaidchart/sdk Nov 21, 2023
@aloisklink aloisklink merged commit ebbbbe6 into main Nov 21, 2023
@aloisklink aloisklink deleted the build/add-nodejs-version-of-sdk branch November 21, 2023 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants