File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -348,15 +348,22 @@ impl Config {
348
348
pub fn get_module ( & self ) -> String {
349
349
match & self . package_specs {
350
350
Some ( OneOrMore :: Single ( PackageSpec { module, .. } ) ) => module. to_string ( ) ,
351
- Some ( OneOrMore :: Multiple ( _) ) => panic ! ( "Multiple package specs not supported" ) ,
351
+ Some ( OneOrMore :: Multiple ( vec) ) => match vec. first ( ) {
352
+ Some ( PackageSpec { module, .. } ) => module. to_string ( ) ,
353
+ None => "commonjs" . to_string ( ) ,
354
+ } ,
352
355
_ => "commonjs" . to_string ( ) ,
353
356
}
354
357
}
355
358
356
359
pub fn get_suffix ( & self ) -> String {
357
360
match & self . package_specs {
358
361
Some ( OneOrMore :: Single ( PackageSpec { suffix, .. } ) ) => suffix. to_owned ( ) ,
359
- Some ( OneOrMore :: Multiple ( _) ) => panic ! ( "Multiple package specs not supported" ) ,
362
+ Some ( OneOrMore :: Multiple ( vec) ) => match vec. first ( ) {
363
+ Some ( PackageSpec { suffix, .. } ) => suffix. to_owned ( ) ,
364
+ None => None ,
365
+ } ,
366
+
360
367
_ => self . suffix . to_owned ( ) ,
361
368
}
362
369
. unwrap_or ( ".js" . to_string ( ) )
You can’t perform that action at this time.
0 commit comments