File tree 2 files changed +11
-2
lines changed 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,15 @@ impl CargoManifest {
66
66
if let Some ( s) = scope {
67
67
self . package . name = format ! ( "@{}/{}" , s, self . package. name) ;
68
68
}
69
+ let mut files = vec ! [ wasm_file] ;
70
+
71
+ match dts_file {
72
+ Some ( ref dts_file) => {
73
+ files. push ( dts_file. to_string ( ) ) ;
74
+ }
75
+ None => { }
76
+ }
77
+
69
78
NpmPackage {
70
79
name : self . package . name ,
71
80
collaborators : self . package . authors ,
@@ -76,7 +85,7 @@ impl CargoManifest {
76
85
ty : "git" . to_string ( ) ,
77
86
url : repo_url,
78
87
} ) ,
79
- files : vec ! [ wasm_file ] ,
88
+ files : files ,
80
89
main : js_file,
81
90
types : dts_file,
82
91
}
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ fn it_creates_a_package_json_default_path() {
40
40
pkg. repository. url,
41
41
"https://github.com/ashleygwilliams/wasm-pack.git"
42
42
) ;
43
- assert_eq ! ( pkg. files, [ "wasm_pack_bg.wasm" ] ) ;
43
+ assert_eq ! ( pkg. files, [ "wasm_pack_bg.wasm" , "wasm_pack.d.ts" ] ) ;
44
44
assert_eq ! ( pkg. main, "wasm_pack.js" ) ;
45
45
let types = pkg. types . unwrap_or_default ( ) ;
46
46
assert_eq ! ( types, "wasm_pack.d.ts" ) ;
You can’t perform that action at this time.
0 commit comments