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

The deployed module doesn't seem to follow current nodejs conventions #1

Closed
julienw opened this issue May 26, 2021 · 8 comments
Closed

Comments

@julienw
Copy link

julienw commented May 26, 2021

See import-js/eslint-plugin-import#2098 (comment) for more insight.

@ljharb
Copy link

ljharb commented May 26, 2021

Specifically, if you want the package to be requireable/importable, you need to specify "main" and "exports".

@mstange
Copy link
Owner

mstange commented May 26, 2021

This module was produced by wasm-pack, and I think I even filed this very bug at some point: rustwasm/wasm-pack#94
Maybe I never repackaged after the fix. I'll try that.

@mstange
Copy link
Owner

mstange commented May 26, 2021

Updating the dependencies and building with wasm-pack build --out-name index fixes this. I'm currently testing the output and will release a new version soon.

@mstange
Copy link
Owner

mstange commented May 26, 2021

@ljharb I've published 0.3.0 with the main file now being named index.js. The package.json still doesn't specify any "exports" and I'm not sure what's meant by that - I don't see an "exports" key on these package.json docs.
Is the new version at https://unpkg.com/browse/gecko-profiler-demangle@0.3.0/ correct or does it need more changes?

@ljharb
Copy link

ljharb commented May 26, 2021

You don't really need the "exports" field here, because in this case there's only one .js file in the package.

It looks fine to me, but it really should include "main": "./index.js" to be explicit.

@mstange
Copy link
Owner

mstange commented May 26, 2021

Thanks for the feedback! I filed rustwasm/wasm-pack#1009 on that. However, given the current maintainership status of wasm-pack, it probably won't see any action any time soon. I'll adjust the package.json manually in the meantime.

@mstange
Copy link
Owner

mstange commented May 26, 2021

Ok, fixed in https://unpkg.com/browse/gecko-profiler-demangle@0.3.1/ .

@mstange mstange closed this as completed May 26, 2021
@julienw
Copy link
Author

julienw commented May 27, 2021

Thanks for the quick update @mstange :-)

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

No branches or pull requests

3 participants