File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 18
18
[ #4082 ] ( https://github.com/rustwasm/wasm-bindgen/pull/4082 )
19
19
[ #4088 ] ( https://github.com/rustwasm/wasm-bindgen/pull/4088 )
20
20
21
+ * Fixed emitted ` package.json ` structure to correctly specify its dependencies
22
+ [ #4091 ] ( https://github.com/rustwasm/wasm-bindgen/pull/4091 )
23
+
21
24
--------------------------------------------------------------------------------
22
25
23
26
## [ 0.2.93] ( https://github.com/rustwasm/wasm-bindgen/compare/0.2.92...0.2.93 )
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ anyhow = "1.0"
18
18
base64 = " 0.22"
19
19
log = " 0.4"
20
20
rustc-demangle = " 0.1.13"
21
+ serde = { version = " 1.0" , features = [" derive" ] }
21
22
serde_json = " 1.0"
22
23
tempfile = " 3.0"
23
24
unicode-ident = " 1.0.5"
Original file line number Diff line number Diff line change @@ -641,12 +641,18 @@ impl Output {
641
641
}
642
642
643
643
if !gen. npm_dependencies . is_empty ( ) {
644
- let map = gen
645
- . npm_dependencies
646
- . iter ( )
647
- . map ( |( k, v) | ( k, & v. 1 ) )
648
- . collect :: < BTreeMap < _ , _ > > ( ) ;
649
- let json = serde_json:: to_string_pretty ( & map) ?;
644
+ #[ derive( serde:: Serialize ) ]
645
+ struct PackageJson < ' a > {
646
+ dependencies : BTreeMap < & ' a str , & ' a str > ,
647
+ }
648
+ let pj = PackageJson {
649
+ dependencies : gen
650
+ . npm_dependencies
651
+ . iter ( )
652
+ . map ( |( k, v) | ( k. as_str ( ) , v. 1 . as_str ( ) ) )
653
+ . collect ( ) ,
654
+ } ;
655
+ let json = serde_json:: to_string_pretty ( & pj) ?;
650
656
fs:: write ( out_dir. join ( "package.json" ) , json) ?;
651
657
}
652
658
You can’t perform that action at this time.
0 commit comments