@@ -297,11 +297,16 @@ fn read_dependencies(
297
297
project_root : & Path ,
298
298
workspace_root : & Option < PathBuf > ,
299
299
show_progress : bool ,
300
+ build_dev_deps : bool ,
300
301
) -> Vec < Dependency > {
301
- return parent_config
302
- . bs_dependencies
303
- . to_owned ( )
304
- . unwrap_or_default ( )
302
+ let mut dependencies = parent_config. bs_dependencies . to_owned ( ) . unwrap_or_default ( ) ;
303
+
304
+ // Concatenate dev dependencies if build_dev_deps is true
305
+ if build_dev_deps && let Some ( dev_deps) = parent_config. bs_dev_dependencies . to_owned ( ) {
306
+ dependencies. extend ( dev_deps) ;
307
+ }
308
+
309
+ dependencies
305
310
. iter ( )
306
311
. filter_map ( |package_name| {
307
312
if registered_dependencies_set. contains ( package_name) {
@@ -360,7 +365,8 @@ fn read_dependencies(
360
365
& canonical_path,
361
366
project_root,
362
367
workspace_root,
363
- show_progress
368
+ show_progress,
369
+ build_dev_deps
364
370
) ;
365
371
366
372
Dependency {
@@ -371,7 +377,7 @@ fn read_dependencies(
371
377
dependencies,
372
378
}
373
379
} )
374
- . collect :: < Vec < Dependency > > ( ) ;
380
+ . collect ( )
375
381
}
376
382
377
383
fn flatten_dependencies ( dependencies : Vec < Dependency > ) -> Vec < Dependency > {
@@ -461,6 +467,7 @@ fn read_packages(
461
467
project_root : & Path ,
462
468
workspace_root : & Option < PathBuf > ,
463
469
show_progress : bool ,
470
+ build_dev_deps : bool ,
464
471
) -> Result < AHashMap < String , Package > > {
465
472
let root_config = read_config ( project_root) ?;
466
473
@@ -477,6 +484,7 @@ fn read_packages(
477
484
project_root,
478
485
workspace_root,
479
486
show_progress,
487
+ build_dev_deps,
480
488
) ) ;
481
489
dependencies. iter ( ) . for_each ( |d| {
482
490
if !map. contains_key ( & d. name ) {
@@ -596,7 +604,7 @@ pub fn make(
596
604
show_progress : bool ,
597
605
build_dev_deps : bool ,
598
606
) -> Result < AHashMap < String , Package > > {
599
- let map = read_packages ( root_folder, workspace_root, show_progress) ?;
607
+ let map = read_packages ( root_folder, workspace_root, show_progress, build_dev_deps ) ?;
600
608
601
609
/* Once we have the deduplicated packages, we can add the source files for each - to minimize
602
610
* the IO */
0 commit comments