feat: export dist wasm files and package.json - #228
Conversation
| } | ||
| }, | ||
| "./dist/*.wasm": "./dist/*.wasm", | ||
| "./package.json": "./package.json" |
There was a problem hiding this comment.
I understand .wasm, but what is package.json needed for?
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
@khaledhosny, the package.json export was dropped but the PR’s title wasn’t revised, which made the automatically generated change log inaccurate: https://github.com/harfbuzz/harfbuzzjs/releases/tag/v1.6.1
|
Thanks! |
|
Yay we got @danielroe’s contribution! |
|
lovely to bump into you here! @lianghai! |
currently esm users can't import individual
wasmfiles - 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)