rustwasm / book

The Rust and WebAssembly Book
https://rustwasm.github.io/docs/book/
MIT License
1.73k stars 208 forks source link

Add alternative to npm link #156

Closed Reeywhaar closed 5 years ago

Reeywhaar commented 5 years ago

Add alternative to npm link

npm link method of adding wasm package described in hello-world.md polluting global npm package space and is not necessary for tutorial purposes, so I decided to add alternative method. Package can be added by relative path in www/package.json.

Though I made it as a footnote, I think maintainers should consider of making it default method, as it much easier than dealing with npm link. If so, I can adjust PR. Let me know what you think.

Thank you :-)

Pauan commented 5 years ago

@fitzgen Yeah, relative paths are a great way of handling local packages. I've used them many times.

I definitely recommend it over npm link (which is intended for temporarily replacing registry packages with a local version of the same package, for testing/debug purposes).