Implement transitive support for NPM dependencies

This commit implements [RFC 8], which enables transitive and transparent
dependencies on NPM. The `module` attribute, when seen and not part of a
local JS snippet, triggers detection of a `package.json` next to
`Cargo.toml`. If found it will cause the `wasm-bindgen` CLI tool to load
and parse the `package.json` within each crate and then create a merged
`package.json` at the end.

[RFC 8]: https://github.com/rustwasm/rfcs/pull/8
This commit is contained in:
Alex Crichton
2019-02-27 12:20:33 -08:00
parent 6522968fb6
commit 6edb40a807
6 changed files with 111 additions and 2 deletions

View File

@ -17,6 +17,7 @@ macro_rules! shared_api {
local_modules: Vec<LocalModule<'a>>,
inline_js: Vec<&'a str>,
unique_crate_identifier: &'a str,
package_json: Option<&'a str>,
}
struct Import<'a> {