diff --git a/src/manifest/mod.rs b/src/manifest/mod.rs index bf715a81..9261195f 100644 --- a/src/manifest/mod.rs +++ b/src/manifest/mod.rs @@ -668,6 +668,7 @@ impl CrateData { let js_bg_file = format!("{}_bg.js", name_prefix); files.push(js_bg_file); } + files.push("snippets".into()); let pkg = &self.data.packages[self.current_idx]; let npm_name = match scope { diff --git a/tests/all/manifest.rs b/tests/all/manifest.rs index 8d4af2df..84e61324 100644 --- a/tests/all/manifest.rs +++ b/tests/all/manifest.rs @@ -105,6 +105,7 @@ fn it_creates_a_package_json_default_path() { "js_hello_world_bg.js", "js_hello_world_bg.wasm", "js_hello_world.js", + "snippets", ] .iter() .map(|&s| String::from(s)) @@ -135,6 +136,7 @@ fn it_creates_a_package_json_provided_path() { "js_hello_world_bg.js", "js_hello_world_bg.wasm", "js_hello_world.js", + "snippets", ] .iter() .map(|&s| String::from(s)) @@ -165,6 +167,7 @@ fn it_creates_a_package_json_provided_path_with_scope() { "js_hello_world_bg.js", "js_hello_world_bg.wasm", "js_hello_world.js", + "snippets", ] .iter() .map(|&s| String::from(s)) @@ -199,6 +202,7 @@ fn it_creates_a_pkg_json_with_correct_files_on_node() { "js_hello_world_bg.wasm", "js_hello_world.d.ts", "js_hello_world.js", + "snippets", ] .iter() .map(|&s| String::from(s)) @@ -233,6 +237,7 @@ fn it_creates_a_pkg_json_with_correct_files_on_nomodules() { "js_hello_world.d.ts", "js_hello_world_bg.wasm", "js_hello_world.js", + "snippets", ] .iter() .map(|&s| String::from(s)) @@ -265,11 +270,16 @@ fn it_creates_a_package_json_with_correct_files_when_out_name_is_provided() { assert_eq!(pkg.side_effects, vec!["./index.js", "./snippets/*"]); let actual_files: HashSet = pkg.files.into_iter().collect(); - let expected_files: HashSet = - ["index_bg.wasm", "index_bg.js", "index.d.ts", "index.js"] - .iter() - .map(|&s| String::from(s)) - .collect(); + let expected_files: HashSet = [ + "index_bg.wasm", + "index_bg.js", + "index.d.ts", + "index.js", + "snippets", + ] + .iter() + .map(|&s| String::from(s)) + .collect(); assert_eq!(actual_files, expected_files); } @@ -315,6 +325,7 @@ fn it_creates_a_package_json_with_correct_keys_when_types_are_skipped() { "js_hello_world_bg.wasm", "js_hello_world_bg.js", "js_hello_world.js", + "snippets", ] .iter() .map(|&s| String::from(s)) @@ -356,6 +367,7 @@ fn it_creates_a_package_json_with_npm_dependencies_provided_by_wasm_bindgen() { "js_hello_world_bg.wasm", "js_hello_world_bg.js", "js_hello_world.js", + "snippets", ] .iter() .map(|&s| String::from(s))