2

I have an existing cargo project which I would like to work with web-asm. However, wasm-pack build fails because my project is a binary rather than a library. How can I circumvent this problem while still keeping my version control history?

Roquentin
  • 177
  • 2
  • 12

1 Answers1

3

These answers may help you : https://stackoverflow.com/a/26946705/11732874

It works for a default bin package on edition 2018. You can put this in your cargo.toml

[lib]
name = "YourPackageName"
path = "src/PathToMain.rs"

How can I circumvent this problem while still keeping my version control history?

What do you mean ?

Lyokolux
  • 1,227
  • 2
  • 10
  • 34
  • For the part of your answer that should've been a comment, I believe they're trying to ask is along the lines of [Is it possible to move/rename files in Git and maintain their history?](https://stackoverflow.com/a/2314757/12101554) – Samathingamajig Dec 30 '22 at 04:48