File tree Expand file tree Collapse file tree 3 files changed +5
-1
lines changed Expand file tree Collapse file tree 3 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ struct NpmPackage {
32
32
license : Option < String > ,
33
33
repository : Option < Repository > ,
34
34
files : Vec < String > ,
35
+ main : String ,
35
36
}
36
37
37
38
#[ derive( Serialize ) ]
@@ -68,7 +69,8 @@ impl CargoManifest {
68
69
ty : "git" . to_string ( ) ,
69
70
url : repo_url,
70
71
} ) ,
71
- files : vec ! [ js_file, wasm_file] ,
72
+ files : vec ! [ js_file. clone( ) , wasm_file] ,
73
+ main : js_file,
72
74
}
73
75
}
74
76
}
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ fn it_creates_a_package_json_default_path() {
41
41
"https://github.com/ashleygwilliams/wasm-pack.git"
42
42
) ;
43
43
assert_eq ! ( pkg. files, [ "wasm_pack.js" , "wasm_pack_bg.wasm" ] ) ;
44
+ assert_eq ! ( pkg. main, "wasm_pack.js" ) ;
44
45
}
45
46
46
47
#[ test]
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ pub struct NpmPackage {
12
12
pub license : String ,
13
13
pub repository : Repository ,
14
14
pub files : Vec < String > ,
15
+ pub main : String ,
15
16
}
16
17
17
18
#[ derive( Deserialize ) ]
You can’t perform that action at this time.
0 commit comments