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

feat(JavaScript): Support ESM #1347

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

theweipeng
Copy link
Member

ESM is the next-generation module system for javascript. We should support it.

@theweipeng theweipeng changed the title feat(JavaScript): Support esm feat(JavaScript): Support ESM Jan 19, 2024

const fury = new Fury.default({ hps: Hps, refTracking: false, useSliceString: true });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we use esm format, here we can remove this default

"scripts": {
"build": "tsc",
"build": "tsc -p tsconfig.json && tsc -p tsconfig.esm.json",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may produce two typings, and we indeed need one.

we can set declaration: false in the tsconfig.esm.json, and use:

    "declaration": true,
    "declarationDir": "types"

in the tsconfig.json.

finally, set "types": "types/index.d.ts" in package.json

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.

None yet

2 participants