Skip to content

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
import { fileURLToPath } from 'url';
import { spawn } from 'child_process';

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

"module": "dist/esm/index.js",
"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

@esafak
Copy link
Contributor

esafak commented Jul 5, 2025

@chaokunyang Is this OK?
@theweipeng Doesn't this need some tests?

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.

3 participants