Skip to content

feat: export dist wasm files and package.json - #228

Merged
khaledhosny merged 2 commits into
harfbuzz:mainfrom
danielroe:fix/export-subset-wasm
Aug 25, 2026
Merged

feat: export dist wasm files and package.json#228
khaledhosny merged 2 commits into
harfbuzz:mainfrom
danielroe:fix/export-subset-wasm

Conversation

@danielroe

Copy link
Copy Markdown
Contributor

currently esm users can't import individual wasm files - this exposes them so (for example) this documented example continues to work:

https://github.com/harfbuzz/harfbuzzjs/blob/main/examples/harfbuzz-subset.example.node.js#L12-L16

(my motivation: I'm trying to prepare a PR to https://github.com/papandreou/subset-font to update to the latest version of harfbuzzjs, and it needs direct wasm access)

Comment thread package.json Outdated
}
},
"./dist/*.wasm": "./dist/*.wasm",
"./package.json": "./package.json"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I understand .wasm, but what is package.json needed for?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

happy to drop it - I have no particular need of it, but added it as I often do in case people need to check the version of the package that is installed, e.g.:

import pkg from 'harfbuzzjs/package.json'

echo(pkg.version)

the alternative, should this be needed, is doing strange things to find the directory of the package, and then readFileSync - but of course this is theoretical as I guess no one's asked for this yet!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Drop it then, please.

Comment thread package.json Outdated
@khaledhosny
khaledhosny merged commit 739196a into harfbuzz:main Aug 25, 2026
3 checks passed
@khaledhosny

Copy link
Copy Markdown
Contributor

Thanks!

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