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

option to rename package name in package.json instead of using the same package name #949

Open
funfoolsuzi opened this issue Dec 26, 2020 · 2 comments

Comments

@funfoolsuzi
Copy link

💡 Feature description

I want the option to rename the generated package name in package.json instead of using the same package name from cargo.toml.
Because my cargo package on crates.io has this name that I really like but it is not available on npm anymore.
I don't want to change my package name on crates.io so I have to rename my generated package name to something else.

💻 Basic example

wasm-pack build --package-name my_pkg_on_npm will yield a package.json:

{
  "name": "my_pkg_on_npm",
  "collaborators": [
    "bts<bts@example.com>"
  ],
  "description": "It's an awesome package but the name has already taken on npm  :(",
  "version": "0.1.2",
  ...
}
@jamesmishra
Copy link

jamesmishra commented Apr 28, 2021

I think this issue is a duplicate of #427

That said, I agree that it should be possible to change the NPM package name from wasm-pack's command line arguments.

@woile
Copy link

woile commented May 28, 2024

This would be nice, specially to set the scope of an org. I wonder if we could have some settings in the Cargo.toml to customize the package.json 🤔

sd2k added a commit to grafana/augurs that referenced this issue Sep 24, 2024
This requires a bit of hackery to make sure wasm-pack emits files
with the right names and references, and to fix the package name
before publishing to npm.

Once rustwasm/wasm-pack#949 is fixed we
can remove the bit of prepublish.js that renames the package.
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