feat(manifest): add main entry

master
Ashley Williams 7 years ago
parent 5641d5c6fd
commit e374314a32
  1. 4
      src/manifest.rs
  2. 1
      tests/manifest/main.rs
  3. 1
      tests/manifest/utils.rs

@ -32,6 +32,7 @@ struct NpmPackage {
license: Option<String>,
repository: Option<Repository>,
files: Vec<String>,
main: String,
}
#[derive(Serialize)]
@ -68,7 +69,8 @@ impl CargoManifest {
ty: "git".to_string(),
url: repo_url,
}),
files: vec![js_file, wasm_file],
files: vec![js_file.clone(), wasm_file],
main: js_file,
}
}
}

@ -41,6 +41,7 @@ fn it_creates_a_package_json_default_path() {
"https://github.com/ashleygwilliams/wasm-pack.git"
);
assert_eq!(pkg.files, ["wasm_pack.js", "wasm_pack_bg.wasm"]);
assert_eq!(pkg.main, "wasm_pack.js");
}
#[test]

@ -12,6 +12,7 @@ pub struct NpmPackage {
pub license: String,
pub repository: Repository,
pub files: Vec<String>,
pub main: String,
}
#[derive(Deserialize)]

Loading…
Cancel
Save